.NET 3.5的Windows窗体应用程序:86 VS 64的加载时间对64位Vista [英] .Net 3.5 Windows Forms Application: x86 vs x64 load times on 64 bit Vista
问题描述
我们正在开发的Winforms应用和在优化启动时间的过程
We are developing a Winforms application and in the process of optimizing the start-up time.
该应用程序运行在64位Vista的机器。在我们的测试中,我们发现了什么似乎是一个反直觉的结果。所有其他条件相同,针对32位和64位的负荷一半的时间。任何人都可以提供一些线索,为什么?
The app runs on 64 bit Vista machines. In our testing we found what seems like a counter intuitive result. All else equal, targeting 32-bit vs 64-bit loads in half the time. Can anyone shed some light as to why?
感谢。
我们通过部署的ClickOnce应用程序当中,从我们的研究开始的应用程序在一个独特的沙盒。因此,它总是冷启动,以便寻求提高的性能在这里是无果而终。
We deploy the app via ClickOnce which, from our research starts apps in a unique sandbox. Therefore it always cold-starts so looking to improve performance here was fruitless.
我们的主要问题是32位的DLL项目的存在。一旦我们针对86的项目(即使它运行在64位)的加载时间减少了一半。 [/编辑]
Our main problem was the existence of 32-bit dlls in the project. Once we targeted the project at x86 (even though it runs on x64) the load times were cut in half. [/Edit]
推荐答案
.NET 3.5 SP1通过不再验证来自受信任位置组件的强名称获取其改进的启动PERF。有一点在我的书争议,但有些站不住脚。
.NET 3.5 SP1 gets its improved startup perf by no longer verifying the strong name of assemblies that come from trusted locations. A bit controversial in my book but somewhat defensible.
我没有检查,如果64位版本的CLR也绕过了费时的步骤。签署一个DLL,把它在GAC,然后打补丁一个字节。加载部件时,无投诉。所以它不是SP1的启动$ P $粉煤的改进,解释的差异。
I did check if the 64-bit version of the CLR also bypasses that time-consuming step. Signed a DLL, put it in the GAC, then patched a byte. No complaints when loading the assembly. So it is not the SP1 startup pref improvement that explains the difference.
的其它因素中的启动时间是: - 从磁盘加载CLR(冷启动只) - 卑躬屈膝的依赖程序集 - JIT编译启动code
Other factors in the startup time are: - Loading the CLR from disk (coldstart only) - Groveling for the dependent assemblies - JIT compiling the startup code
冷启动很可能是一个因素,你可能没有其他进程运行具有64位版本中加载的CLR的。易消除通过运行一个虚拟的.net应用程序,而你做测试。
Coldstart could well be a factor, you probably don't have other processes running that have the 64-bit version of the CLR loaded. Easy to eliminate by running a dummy .NET app while you do the test.
匍匐组件可能需要更长的时间为相同的原因。这是不可能的.NET程序集的64位NGEN-ED映像的文件系统缓存。再次,易于消除与具有相同组件的依赖关系的虚设应用
Groveling assemblies could take longer for the same reason. It is unlikely that the 64-bit ngen-ed images of the .NET assemblies are in the file system cache. Again, easy to eliminate with the dummy app having a dependency on the same assemblies.
64位抖动是一个难啃的骨头。任意调用假设MSFT没有花太多的时间做一个高性能的32位抖动。没有备份通过任何迹象。很难衡量过,你必须装入的Assembly.Load装配,然后时间Activator.CreateInstance(),其中类的构造函数调用高达code越好。
The 64-bit JITter is a tougher nut to crack. An arbitrary call is to assume that MSFT didn't spend as much time making that one performant as the 32-bit JITter. Nothing backed-up by any evidence though. Difficult to measure too, you'd have load an assembly with Assembly.Load, then time Activator.CreateInstance() where the class constructor calls as much code as possible.
这篇关于.NET 3.5的Windows窗体应用程序:86 VS 64的加载时间对64位Vista的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!