.NET应用程序启动缓慢 [英] Slow startup for .NET applications

查看:132
本文介绍了.NET应用程序启动缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我想出来,对于任何基于.NET的应用程序的首次执行,例如VB.NET或C#的
,需要7-8秒看到任何

应用程序的主要形式,即使应用程序包含一个表单和一个

按钮,只有32kb大小。第二次执行(没有重新启动

机器)不到一秒钟就完成了。


启动速度不会在非.NET上发生有源应用程序如VB6,MFC或VC ++ 6应用程序的
。如果一个应用程序由.NET驱动

打开需要7-8秒才能看到第一个表单。


但是,我认为是那种第一次执行时,框架被加载到内存中,然后第二次打开的时间少于一秒,因为框架仍然在内存中我猜想或者

有点。


我听说有些技术可以加速.NET应用程序的慢启动,

但我知道他们都不知道好的。


注意:我有1GB的DDR内存+ 2.4GHZ处理器,有很多免费的系统资源,这必须意味着超过足够。对于.NET。


我希望有人可以解释为什么非.NET驱动的应用程序打开的时间少于b
$ b(双击)但是。 NET应用程序在7-8秒内打开,首次执行时为



谢谢。

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.

推荐答案



AFAIK


这是因为编译,只要程序集保持在

相同的位置和版本没有改变它应该仍然立即开始

也在重新启动后


HTH


米歇尔


" kimiraikkonen" < ki ************* @ gmail.comschreef在bericht

新闻:c3 ***************** ***************** @ s12g2000 prg.googlegroups.com ...

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...

你好,

我想通过,对于任何基于.NET的应用程序的第一次执行,例如VB.NET或C#,
,需要7-8秒才能看到任何的主要形式。

应用程序甚至应用程序包含一个表单和一个

按钮,只有32kb大小。第二次执行(没有重新启动

机器)不到一秒钟就完成了。


启动速度不会在非.NET上发生有源应用程序如VB6,MFC或VC ++ 6应用程序的
。如果一个应用程序由.NET驱动

打开需要7-8秒才能看到第一个表单。


但是,我认为是那种第一次执行时,框架被加载到内存中,然后第二次打开的时间少于一秒,因为框架仍然在内存中我猜想或者

有点。


我听说有些技术可以加速.NET应用程序的慢启动,

但我知道他们都不知道好的。


注意:我有1GB的DDR内存+ 2.4GHZ处理器,有很多免费的系统资源,这必须意味着超过足够。对于.NET。


我希望有人可以解释为什么非.NET驱动的应用程序打开的时间少于b
$ b(双击)但是。第一次执行时,NET应用程序将在7-8秒内打开




谢谢。
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.



1月1日晚上9:06,Michel Posseth [MCP]" < msn ... @ posseth.comwrote:
On Jan 1, 9:06 pm, "Michel Posseth [MCP]" <msn...@posseth.comwrote:

AFAIK


这是因为编译而发生的,只要程序集保持在

相同的位置,版本没有变化它应该仍然立即启动

也可以在重新启动后


HTH


米歇尔


" kimiraikkonen" < kimiraikkone ... @ gmail.comschreef in berichtnews:c3 ********************************** @ s 12g2000prg.googlegroups.com ...
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...

您好,

我想通了,因为任何基于.NET的应用程序的第一次执行这样

作为VB.NET或C#,看到任何

应用程序的主要形式需要7-8秒,即使该应用程序包含一个表单和一个

按钮,只有32kb大小。第二次执行(不重启

机器)完成不到一秒钟。
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.


启动速度不会出现在非.NET驱动的应用程序上,例如VB6,MFC,
或VC ++ 6应用程序。如果一个应用程序由.NET驱动,则需要7-8秒才能打开,以查看第一个表单。
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.


我听说有些技术可以加速.NET应用程序的慢启动,

但是他们都不知道。
I heard some techiniques for accelerating slow startup on .NET apps,
but none of them i know good.


注意:我有1GB的DDR内存+ 2.4GHZ处理器,有很多免费的

系统资源,这必须意味着更多而不是足够的对于.NET。
Note: I have 1gb DDR memory + 2.4GHZ processor with a lot of free
system resource which must mean more than "enough" for .NET.


我希望有人能解释为什么非.NET驱动的应用程序打开的时间少于b
$ b点击)但是第一次执行时,.NET应用程序在7-8秒内打开


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.



我不这么认为,虽然没有位置或没有代码更改,但在下一次

重新启动后,再次第一个

执行需要7-8秒才能打开应用程序。没有重启的第二次执行只需不到一秒钟。

有什么东西被加载到我认为的内存中?然而,有一些这个与问题相关的线程在组中看起来很常见,

在许多不同的计算机上只有.net。没有问题

VB6或MFC支持的应用程序有关启动时间。


PS:使用.net framework 2.0,XP SP2。

问候。

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.


" kimiraikkonen" < ki ************* @ gmail.comschrieb:
"kimiraikkonen" <ki*************@gmail.comschrieb:

我想通了,对于任何.NET的第一次执行 - 有源应用程序如VB.NET或C#的
,即使应用程序包含单个表单,也需要7-8秒才能看到任何

应用程序的主要形式和一个

按钮,只有32kb大小。第二次执行(不重启

机器)完成不到一秒钟。
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.



请注意,执行基于.NET的应用程序需要启动Common

语言运行时(CLR)并加载一些较大的库( mscorlib,

System.Windows.Forms.dll用于Windows窗体应用程序,

" Microsoft.VisualBasic.dll"以及其他一些DLL )。这将花费一些时间来支付b $ b。此外,Just-In-Time编译器(JIT编译器)将需要在执行a之前将中间语言代码(IL代码)转换为机器代码

方法)。

启动.NET应用程序后,所需的文件已经放在(磁盘)缓存的
中,因此启动时间将大大缩短。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org />

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>

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/>


这篇关于.NET应用程序启动缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆