为什么我的 .net 应用程序在机器重新启动后启动速度非常慢?
有谁知道为什么机器重新启动(即冷启动)后启动.net应用程序如此缓慢?
在谷歌研究后,我发现了一些加快速度的线索,即
- 合并程序集
- 设置资源语言
- NGEN
- GAC 安装等。
这是否足以使我的 .net 应用程序更快,或者我还缺少其他什么吗?
Does anyone know why it is so horribly slow to start a .net application after the machine is rebooted(i.e cold start) ?
After researching in google I found some clues for speeding it up i.e.
- Merging assemblies
- Setting resource language
- NGEN
- GAC installation, etc.
Is that all enough to make my .net application faster or anything else is there I am missing ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另一个原因可能是 Authenticode 签名的程序集且没有互联网连接。请参阅为什么签名的程序集加载缓慢?和WPF 应用程序启动速度慢。
Another reason could be Authenticode signed assemblies and no internet connection. See Why are signed assemblies slow to load? and WPF application slow on startup for example.
您可以使用 SysInternals 中的 ProcMon 在启动过程中分析您的应用程序。这将记录所有带有时间戳的注册表/文件访问。它可能会向您指出出现延迟的区域。
另外,冷启动时,您的机器是否有大量磁盘访问?您的病毒扫描程序是否在启动时进行全面扫描?
You could use ProcMon from SysInternals to profile your app during startup. This will log all registry/file access with time stamp. It may point you in an area where there's a delay.
Also, when cold booting, does your machine have a lot of disc access? Is your virus scanner doing a full scan at boot?
如果您从硬盘驱动器中提取大量文件,那么您的系统尚未加载它们。这可能是启动缓慢的原因。
此外,如果您没有给系统足够的时间来启动,它仍然可能会同时加载其他应用程序。
If you are pulling up a large number of files from the hard drive, then your system hasn't loaded them yet. This could be the reason for the slow start.
Also, if you haven't given your system sufficient time to boot up, it could still be loading other applications at the same time.
正如其他人所说,您的计算机在启动后的最初几分钟内可能仍在加载其他应用程序。您的硬盘(最慢的组件之一)正忙于尝试加载其他应用程序及其各自的数据。
如果您的计算机上有第二个磁盘,请尝试在第二个磁盘上安装您的应用程序。如果第二个磁盘在这段时间通常处于空闲状态,我认为该应用程序的启动速度会更快。
As others have stated, your computer is probably still loading other applications during the first few minutes after bootup. Your hard disk (one of the slowest components) is busy trying to load those other apps and their respective data.
If you have a second disk on your computer, try installing your app on the second disk. If the second disk is usually idle during this time, I'm thinking that the app will start up much more quickly.