473,465 Members | 4,823 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Slow startup for .NET applications

Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.

This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.

However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.

I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.

Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.

I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.

Thanks.
Jan 1 '08 #1
10 18031

AFAIK

This happens because of Compilation , as long as the assembly stays at the
same location and the version doesn`t change it should still start instantly
also after a reboot

HTH

Michel

"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:c3**********************************@s12g2000 prg.googlegroups.com...
Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.

This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.

However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.

I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.

Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.

I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.

Thanks.

Jan 1 '08 #2
On Jan 1, 9:06 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:
AFAIK

This happens because of Compilation , as long as the assembly stays at the
same location and the version doesn`t change it should still start instantly
also after a reboot

HTH

Michel

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in berichtnews:c3**********************************@s 12g2000prg.googlegroups.com...
Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.
This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.
However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.
I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.
Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.
I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.
Thanks.
I don't think so, though no location or no code change, but after next
reboot, again it takes 7-8 seconds to open app for the first
execution. Second execution without reboot takes less than a second.
Something is being loaded into memory i supposed? However there are
some this issue-related threads in group which seems common,
experienced on many different computers for only .net. No problem in
VB6 or MFC powered apps about startup time.

PS: Using .net framework 2.0, XP SP2.

Regards.
Jan 1 '08 #3
"kimiraikkonen" <ki*************@gmail.comschrieb:
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.
Note that executing a .NET-based application requires startup of the Common
Language Runtime (CLR) and loading of some larger libraries ("mscorlib",
"System.Windows.Forms.dll" for Windows Forms applications,
"Microsoft.VisualBasic.dll", and some other DLLs respectively). This will
take some time. In addition, the Just-In-Time compiler (JIT compiler) will
have to translate the Intermediate Language code (IL code) to machine code
prior to execution of a method).

After starting a .NET application, the required files are already placed in
the (disk) cache and thus startup time will be drastically reduced.

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

Jan 1 '08 #4
Interesting .......

Just did some tests on my private system , DELL Dimension , Intell E6400 a
VIIV version of that processor , 2 GB Memory 667 mhz , Geforce 7900 GS 256
MB , SATA Stripe 500 Gb with Windows mediacenter 2005
1, 2 , 3 program starts , second time boef program is there instantly ,
start other program ( wich uses data etc etc ) 1,2 program starts , second
time boef program is there instantly

i copy one of the programs that start instantly to another location on my
disk , 1,2 program starts second time boef program is there instantly

I have once read that the compile mechanism worked that way and to my tests
it seems to be right with a litle twist , i guess the answer can be found in
Herfried`s reply
and that my findings are a combination of the compile mechanism and the
preloading of the .Net runtime makes the difference

It also seems that if you have some bether hardware it is not so disturbing

Michel


"kimiraikkonen" <ki*************@gmail.comschreef in bericht
news:45**********************************@h11g2000 prf.googlegroups.com...
On Jan 1, 9:06 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:
>AFAIK

This happens because of Compilation , as long as the assembly stays at
the
same location and the version doesn`t change it should still start
instantly
also after a reboot

HTH

Michel

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in
berichtnews:c3**********************************@ s12g2000prg.googlegroups.com...
Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.
This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.
However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.
I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.
Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.
I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.
Thanks.

I don't think so, though no location or no code change, but after next
reboot, again it takes 7-8 seconds to open app for the first
execution. Second execution without reboot takes less than a second.
Something is being loaded into memory i supposed? However there are
some this issue-related threads in group which seems common,
experienced on many different computers for only .net. No problem in
VB6 or MFC powered apps about startup time.

PS: Using .net framework 2.0, XP SP2.

Regards.

Jan 1 '08 #5
On Jan 1, 10:30 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:
Interesting .......

Just did some tests on my private system , DELL Dimension , Intell E6400 a
VIIV version of that processor , 2 GB Memory 667 mhz , Geforce 7900 GS 256
MB , SATA Stripe 500 Gb with Windows mediacenter 2005
1, 2 , 3 program starts , second time boef program is there instantly ,
start other program ( wich uses data etc etc ) 1,2 program starts , second
time boef program is there instantly

i copy one of the programs that start instantly to another location on my
disk , 1,2 program starts second time boef program is there instantly

I have once read that the compile mechanism worked that way and to my tests
it seems to be right with a litle twist , i guess the answer can be found in
Herfried`s reply
and that my findings are a combination of the compile mechanism and the
preloading of the .Net runtime makes the difference

It also seems that if you have some bether hardware it is not so disturbing

Michel

"kimiraikkonen" <kimiraikkone...@gmail.comschreef in berichtnews:45**********************************@h 11g2000prf.googlegroups.com...
On Jan 1, 9:06 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:
AFAIK
This happens because of Compilation , as long as the assembly stays at
the
same location and the version doesn`t change it should still start
instantly
also after a reboot
HTH
Michel
"kimiraikkonen" <kimiraikkone...@gmail.comschreef in
berichtnews:c3**********************************@s 12g2000prg.googlegroups.com...
Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.
This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.
However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.
I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.
Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.
I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.
Thanks.
I don't think so, though no location or no code change, but after next
reboot, again it takes 7-8 seconds to open app for the first
execution. Second execution without reboot takes less than a second.
Something is being loaded into memory i supposed? However there are
some this issue-related threads in group which seems common,
experienced on many different computers for only .net. No problem in
VB6 or MFC powered apps about startup time.
PS: Using .net framework 2.0, XP SP2.
Regards.
So this is a kind of confirmation though you have much better hardware
but still the latency between two executions is visible.

So, it seems that there isn't much thing to do except upgrading
hardware to accelerate .NET apps' startup. I wish .NET was as fast as
VB6 or other non-.NET technolgies like old VC++, MFC
apps(before .NET), but its powerful classes are better/innovative of
course for developers.

Thanks.
Jan 1 '08 #6
On Jan 1, 2:14*pm, kimiraikkonen <kimiraikkone...@gmail.comwrote:
On Jan 1, 10:30 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:


Interesting .......
Just did some tests on my private system , DELL Dimension * , Intell E6400 a
VIIV version of that processor , 2 GB Memory 667 mhz *, Geforce 7900 GS 256
MB , SATA Stripe 500 Gb *with Windows mediacenter 2005
1, 2 , 3 * program starts , second time *boef program is there instantly *,
start other program *( wich uses data etc etc ) 1,2 program starts *, second
time boef program is there instantly
i copy one of the programs that start instantly to another location on my
disk , 1,2 program starts * second time *boef program is there instantly
I have once read that the compile mechanism worked that way and to my tests
it seems to be right with a litle twist , i guess the answer can be found in
Herfried`s reply
and that my findings are a combination of the compile mechanism and the
preloading of the .Net runtime makes the difference
It also seems that if you have some bether hardware it is not so disturbing
Michel
"kimiraikkonen" <kimiraikkone...@gmail.comschreef in berichtnews:45**********************************@h 11g2000prf.googlegroups.com...
On Jan 1, 9:06 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:
>AFAIK
>This happens because of Compilation *, as long as the assembly stays at
>the
>same location and the version doesn`t change it should still start
>instantly
>also after a reboot
>HTH
>Michel
>"kimiraikkonen" <kimiraikkone...@gmail.comschreef in
>berichtnews:c3**********************************@ s12g2000prg.googlegroups.com...
Hi there,
I figured out, for the first execution for any .NET-powered app such
as VB.NET or C#, it takes 7-8 seconds to see main form of "any"
application even the application consists of a single form and a
button and only 32kb sized. The second execution(without rebooting
machine) is done less than a second.
This slowdown on startup doesn't occur on non-.NET-powered apps such
as VB6, MFC or VC++ 6 applications. If an application is powered
by .NET it takes 7-8 seconds to open, to see the first form.
However, i think that a kind of framework is being loaded into memory
for the first time of execution, then the second opening is done less
than a second due to framework is still in the memory i suppose or
kinda.
I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.
Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.
I hope someone could explain why non-.NET-powered apps is opened less
than a second(double-click) but .NET apps is opened in 7-8 seconds for
the first execution.
Thanks.
I don't think so, though no location or no code change, but after next
reboot, again it takes 7-8 seconds to open app for the first
execution. Second execution without reboot takes less than a second.
Something is being loaded into memory i supposed? However there are
some this issue-related threads in group which seems common,
experienced on many different computers for only .net. No problem in
VB6 or MFC powered apps about startup time.
PS: Using .net framework 2.0, XP SP2.
Regards.

So this is a kind of confirmation though you have much better hardware
but still the latency between two executions is visible.

So, it seems that there isn't much thing to do except upgrading
hardware to accelerate .NET apps' startup. I wish .NET was as fast as
VB6 or other non-.NET technolgies like old VC++, MFC
apps(before .NET), but its powerful classes are better/innovative of
course for developers.

Thanks.- Hide quoted text -

- Show quoted text -
In general, well written .NET apps are not significantly slower then
those other technologies you mention (and in some cases faster). The
biggest performance hit is really in startup, especially cold
startup... Once the framework is in the disk cache, this startup time
is significantly reduced. There are techniques, such as using ngen
that can speed up that time, but like everything there are pro's and
con's to it's use.

--
Tom Shelton
Jan 1 '08 #7
On Tue, 1 Jan 2008 13:26:20 -0800 (PST), Tom Shelton
<to*********@comcast.netwrote:
>In general, well written .NET apps are not significantly slower then
those other technologies you mention
But then, how can we write apps more efficiently when even a basic
form with just a single push-button takes several seconds, while its
VB Classic takes less than a second?

Besides compiling the .Net app before distributing it to customers and
avoid the JIT kicking-in, Isn't it possible to load .Net stuff at
boot-time, so it's available in RAM whenever a .Net app is run?
Jan 2 '08 #8
On 2008-01-02, Gilles Ganault <no****@nospam.comwrote:
On Tue, 1 Jan 2008 13:26:20 -0800 (PST), Tom Shelton
<to*********@comcast.netwrote:
>>In general, well written .NET apps are not significantly slower then
those other technologies you mention

But then, how can we write apps more efficiently when even a basic
form with just a single push-button takes several seconds, while its
VB Classic takes less than a second?
Again, your talking about startup times. You snipped out the part right
after, where I said startup times were an issue... Also, I'd like to
know what hardware your running on that takes several seconds to load a
simple form? Even on my old 1.3 GHz AMD system, it only takes between 1
and 2 seconds....

Still, there are things you can do...

The biggest is to try and avoid as much work as possible durring
initialization. Why? Because .NET only loads satalite assemblies as
needed - basically the first time a type in them is referenced. The
initial load of an assembly (really any dll) is expensive, because it
has to be read from disk, and then mapped into the processes address
space - and if there any address collisions, then it has to be relocated
until free space is found. You can minimize this by making sure your
rebase all of your custom assemblies. So, the smart thing to do here is
basically delay as much intialization as you can - maybe moving it to
background threads once your app has started up.

You can also run a profiler on your application, to find out where it's
spending it's time durring startup. Obviously, you can't do anything
about framework stuff, but you might find that some of the problem is in
code that you can do something about.
Besides compiling the .Net app before distributing it to customers and
avoid the JIT kicking-in, Isn't it possible to load .Net stuff at
boot-time, so it's available in RAM whenever a .Net app is run?
The framework is not in ram, it's in disk cache. I suppose you could
write a app that just started and exited and made it run at startup :)

--
Tom Shelton
Jan 2 '08 #9
The framework is not in ram, it's in disk cache. I suppose you could
write a app that just started and exited and made it run at startup :)
I tried this and did a simple msgbox-based startup app and put into
Windows's startup registry(you know the path) to have framework loaded
into disk cache. Then the next execution of "this" startup app is done
in less than a second, almost instantly. But other .NET apps is still
opened in approx. 3 seconds to see the first form if i use this
putting a simple .NET app into startup technique :) There become an
accelearation quite visible but not as much as classic apps(like
VB6's).

Anyway, it's explict that .NET framework based apps requires very good
hardware especially big disk buffer and high-speed memory not to be
disturbed due to startup latency.

Thanks.

Jan 2 '08 #10

"kimiraikkonen" <ki*************@gmail.comkirjoitti viestissä
news:b7**********************************@d4g2000p rg.googlegroups.com...
>
Anyway, it's explict that .NET framework based apps requires very good
hardware especially big disk buffer and high-speed memory not to be
disturbed due to startup latency.
Try this:

http://technet.microsoft.com/en-us/l...cf(VS.80).aspx

It's located in here (for example):

C:\Windows\Microsoft.NET\Framework\v2.0.50727

-Teemu

Jan 2 '08 #11

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

Similar topics

5
by: Michael Mossey | last post by:
Runnng python 2.2 on HP-UX, I get intermittant slow startup. Sometimes python starts up in a small fraction of a second, and sometimes takes 3-5 seconds. This applies to any script I run, or just...
0
by: Jesus | last post by:
We have an application that access a SQL server DB. We have several offices, all of them connected to the same network. The problem happens with remote locations. Once in a while, the...
1
by: Martin Altemark | last post by:
I have this webapplication, and when unloaded in the webserver because of session timeouts there is a huge difference in the startup times between my own developer computer and the web server it's...
0
by: Daniel Knöpfel | last post by:
Hello We have got a .NET application (.NET 1.1) that the users start from a network share. After start up the user logs in and he can then minimise the application, so that it appears as an icon...
9
by: jeff | last post by:
Hi All. I realize that when my Deployed winforms application starts, Windows needs to load the .net 2 framework before control is given to my application.... Is there anyway to either ... -...
1
by: gazza67 | last post by:
Hi Everyone, I am writing a small .net forms app that rquires a word document to be opened. I use the command process.start(filePath). The command does just as it should and opens the...
11
kestrel
by: kestrel | last post by:
this happened about a week after i got my laptop. Its a Sony FS920. It used to startup file. Nice and fast. Then, about a week later, before i was even able to go on the internet. the startup...
2
by: andrewbb | last post by:
Occasionally I had been getting a 30-60 second delay when starting a Windows service written in .NET. Today I stumbled upon a way to reproduce it without fail: Set the system date to the 31st...
0
by: Mourad | last post by:
After installing SourceSafe integration with Access 2003, th database startup became very slow. My database is big, more than 10,000 objects or so. It seems Access/VSS attempts to refresh the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.