467,859 Members | 1,247 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,859 developers. It's quick & easy.

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
  • viewed: 1733
Share:
4 Replies
"Jm" <ja*****@ihug.com.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.com.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.com.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.com.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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Timothy Graves | last post: by
2 posts views Thread by Robert Wilkens | last post: by
4 posts views Thread by Troy | last post: by
5 posts views Thread by jcrouse | last post: by
11 posts views Thread by Dan Sugalski | last post: by
3 posts views Thread by Mark Reed | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.