473,811 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Speeding up app start time

Jm
Hi all

I know this might sound a little stupid but i thought id better ask anyway
in case there are some things i havent already tried that everybody else
knows. Basically i am wondering if there is any way to speed up the time it
takes for my app to display its first form. There is very little code before
the form loads, pretty much just a line or two to load the images on it but
it still can take quite a while on some machines to start up. Is this
standard with any app because .NET apps take that little bit more to get
going than vb6 ones did ? I have removed references that arent used in the
app to attempt to speed it up, is there anything else i should be looking at
? Any help is greatly appreciated

Thanks
Nov 21 '05 #1
4 1911
"Jm" <ja*****@ihug.c om.au> wrote in message
news:cu******** **@lust.ihug.co .nz...
i am wondering if there is any way to speed up the time it takes for
my app to display its first form.


There's a utility called ngen, that "pre-links" your assembly into a
"Native Image" that should load faster. I did this for some of my
applications and it /did/ make a difference - they loaded about 2%
faster. Not so good.

If you're running the application from a network share (as I am),
rather than from the loca file system, it takes the Framework a long
time to "find" adn load your assemblies. Try loading any shared
ones into the Global Assembly Cache on the local machine. Doing
/this/ gained me somewhere around a 40% improvement (production
application load time is now around 3-4 seconds).

If everything's running from the local file system, though, there's
probably not much that you can do - it really /does/ take a lot to
get a .Net program off the ground; use SysInternals Process
Explorer (or equivalent) and you'll see just how much "junk" each
one needs to load ... ;-)

HTH,
Phill W.
Nov 21 '05 #2
"Jm" <ja*****@ihug.c om.au> schrieb:
I know this might sound a little stupid but i thought id better ask anyway
in case there are some things i havent already tried that everybody else
knows. Basically i am wondering if there is any way to speed up the time
it
takes for my app to display its first form. There is very little code
before
the form loads, pretty much just a line or two to load the images on it
but
it still can take quite a while on some machines to start up. Is this
standard with any app because .NET apps take that little bit more to get
going than vb6 ones did ?


When a .NET application is loaded, the CLR and some huge libraries are
loaded. The JIT compiler will have to translate the MSIL to native code.
You can reduce application start time by creating a native image of the
application on the machine running the application by using "Ngen.exe".
This can be done as part of the application's installation process too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
"Jm" <ja*****@ihug.c om.au> wrote in news:cu******** **@lust.ihug.co .nz:
Hi all

I know this might sound a little stupid but i thought id better ask anyway in case there are some things i havent already tried that everybody else knows. Basically i am wondering if there is any way to speed up the time it takes for my app to display its first form. There is very little code before the form loads, pretty much just a line or two to load the images on it but it still can take quite a while on some machines to start up. Is this
standard with any app because .NET apps take that little bit more to get going than vb6 ones did ? I have removed references that arent used in the app to attempt to speed it up, is there anything else i should be looking at ? Any help is greatly appreciated

Thanks


..net languages compile into MSIL which is what is in your exe file. The
MSIL has to be compiled at run time into processor specific code. (JIT -
just in time compiling). The MSIL ges compiled as it is used and the
final processor specific code is stored in case it gets called again
when the program is running. Unfortunately this means that there is a
delay each time a component in your program gets used for the first
time, subsequent uses of the item during that program run will be much
quicker. Next time the app starts though it has to be compiled again
from MSIL...
You can do pre-JIT compiling so that the MSIL is compiled before run
time (usually done at install time), and so application start times are
improved. The downside of pre-JIT is that the JIT compiler will optimise
the code better. Look up ngen (native image generator) in the msdn for
help on doing this.
Nov 21 '05 #4
Jm
Hi All

Thanks for the info, i will try the things suggested

Thanks again

"Jm" <ja*****@ihug.c om.au> wrote in message
news:cu******** **@lust.ihug.co .nz...
Hi all

I know this might sound a little stupid but i thought id better ask anyway
in case there are some things i havent already tried that everybody else
knows. Basically i am wondering if there is any way to speed up the time it takes for my app to display its first form. There is very little code before the form loads, pretty much just a line or two to load the images on it but it still can take quite a while on some machines to start up. Is this
standard with any app because .NET apps take that little bit more to get
going than vb6 ones did ? I have removed references that arent used in the
app to attempt to speed it up, is there anything else i should be looking at ? Any help is greatly appreciated

Thanks

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
1610
by: Timothy Graves | last post by:
I have a quick (pun intended) question for the guru's out there. I have a piece of code where I am validating the input of chancters into a cell in a datagrid. I am using the keypressed event to get the charcter that the user typed and then allowing it to be passed to the cell. Now here is the tricked part, I am also validating the values (max and min) so that the user does not input a invalid number (out of range ex. byte != 256). ...
2
1564
by: Robert Wilkens | last post by:
Ok... This may be the wrong forum, but it's the first place I'm trying. I'm new to C# and just implemented the 3-tier Distributed application from Chapter 1 (the first walkthrough) in the "Walkthrough" book that comes with Visual Studio .NET 2003 Enterprise Architect. My first observation is -- woah, is this thing slow. From the time I clicked "load" to the time I had a populated data set on the windows-based app was almost 5-10...
4
2507
by: Troy | last post by:
Hello all, I was wondering if there is a way to speed up the rendering of a web page to the client browser... In my case, I am retrieving about 60 - 100 rows of data from an SQL Server and I wish to display these rows the client as I am retrieving them (while looping). I get the results from SQL and populate a dataset, then I loop through the dataset and add the data to an <asp:tablecell> object on the aspx page. Part of the data I...
10
3164
by: Sarah Smith | last post by:
Hello, I am a bit of a newbie to VB.NET, but not totally new. I took the plunge recently and decided (along with my colleagues), to try to convert/port a VB6 client/server app to .Net. (I'm not using any upgrade tools, I'm just re-writing). I have be learning/testing .net with SDI type forms and now I'm actually working on the conversion, I'm starting to worry that VB.net
5
1332
by: jcrouse | last post by:
I have a program that is an external viewer. It is launched with a hotkey from within another application. The program has 30 labels that can be displayed. Since the labels may not always be oriented the same as the Operating System I needed to use the Label_Paint event to PAINT the labels text if it not oriented the same as the operating system. I am trying to figure out a way to make this event happen faster or optimize it if possible. I...
11
2438
by: Dan Sugalski | last post by:
Is there any good way to speed up SQL that uses like and has placeholders? Here's the scoop. I've got a system that uses a lot of pre-generated SQL with placeholders in it. At runtime these SQL statements are fired off (through the C PQexecParams function, if that matters) for execution. No prepares or anything, just bare statements with $1 and friends, with the values passed in as parameters. Straightforward, and no big deal. ...
3
1436
by: Mark Reed | last post by:
All, I have built a database recently which resides on a network server which is constantly being re-structured. This is something I have no control over so have had to incorporate a means by which the backend moving will not cause too much of a headache and anyone can fix. I decided to use an INI file to store several variables which can and often do change. I've also added a logging procedure which writes events to a text file to aid...
0
1243
by: lissbpp | last post by:
Hello, Working in .Net 2.0 using NGen to speed up both my warm and cold startup load times. NGen works beautifully for my application; however, it seams that the native image cache is not persisting across reboots or extended times between application launches. Currently I am NGen'in my code right after a .MSI install, and everything is snappy. However if I reboot the machine, or do not run the application for an extended amount of...
2
4353
by: salad | last post by:
This is a tip on how to speed up listboxes DRAMATICALLY. Persons that would benefit are those that are constantly updating the rowsource of a listbox/combobox in order to filter and sort the data and the refreshes are slow. (OT. I've often wondered why there is no .Sort or .Filter property for Combos and Listboxes.) My listboxes , and their rowsources, on my form were constantly being refreshed to filter and sort data. Ex:
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.