473,796 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ 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(witho ut 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 18094

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

"kimiraikko nen" <ki************ *@gmail.comschr eef in bericht
news:c3******** *************** ***********@s12 g2000prg.google groups.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(witho ut 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

"kimiraikko nen" <kimiraikkone.. .@gmail.comschr eef in berichtnews:c3* *************** *************** ***@s12g2000prg .googlegroups.c om...
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(witho ut 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
"kimiraikko nen" <ki************ *@gmail.comschr ieb:
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(witho ut 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.Visu alBasic.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


"kimiraikko nen" <ki************ *@gmail.comschr eef in bericht
news:45******** *************** ***********@h11 g2000prf.google groups.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.comschr eef in
berichtnews:c3 *************** *************** ****@s12g2000pr g.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(witho ut 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

"kimiraikko nen" <kimiraikkone.. .@gmail.comschr eef in berichtnews:45* *************** *************** ***@h11g2000prf .googlegroups.c om...
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
"kimiraikko nen" <kimiraikkone.. .@gmail.comschr eef in
berichtnews:c3* *************** *************** ***@s12g2000prg .googlegroups.c om...
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(witho ut 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.comwrot e:
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
"kimiraikko nen" <kimiraikkone.. .@gmail.comschr eef in berichtnews:45* *************** *************** ***@h11g2000prf .googlegroups.c om...
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.comschr eef in
>berichtnews:c3 *************** *************** ****@s12g2000pr g.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(witho ut 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*********@co mcast.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*********@c omcast.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

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

Similar topics

5
2211
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 typing 'python' at the prompt. I also observed something similar on Linux. Any ideas what would cause *intermittant* slow startup? -Mike
0
1308
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 application takes a lot of time to load. If I try it on my computer, it loads fine (10+ seconds). The SQL server is on the same building as I am running the app. I'm using w2k, 1.0 framework. The computers have the same
1
1139
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 intended for. On my own computer it loads and executes in about 2-3 seconds when it's more like 12-13 seconds on the web server. How can this be? The computers a similar in configuration hardware-wise. I'm getting crazy with this now - please...
0
1589
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 down on the right hand side (like the date information, msn icon etc.). Now when the user wants use the application he must first maximise it or relogin (if he logged out before). On some machines this maximisation/startup time lasts extremely...
9
2991
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 ... - preload the .net 2 framework (windows startup or whatever) - splash a screen ... application loading ... please wait ... type of
1
5815
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 document with word. HOWEVER the problem is that it takes forever - well about 20 seconds anyway for the document to open.
11
4233
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 started taking forever. So i just put it in hibernate every time i want to turn it off. I tried everything i could find to speed it up. I removed a bunch of startup programs and switched the theme to windows clasic. I took out all the effects and stuff...
2
2240
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 of the current month, the service starts immediately. Set the system date to the 1st of next month, the service hangs for 30-60 seconds. Change back to the 31st and it starts immediately again. etc.
0
1114
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 Source Control status (the little lock icon next to each object), and it takes long time. Is there a way to disable this update process at start up? Any work around to get the database starts as fast as it used to be before the integration?
0
9529
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5443
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
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
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.