10

I have a pretty large and complex winforms application. In an effort to reduce the startup time, I pre-generated serialization assemblies using the following batch file.

; delete any existing serialization assemblies
del *XmlSerializers.dll

; gen new serialization assemblies
for %%a in (*.dll) do sgen /assembly:%%a

; delete .deleted files (generated for assemblies which do not allow serialization)
del *.dll.deleted*

However, to my surprise, the startup time actually went up from 4.6 seconds to 6.1 seconds - a jump of 1.5 seconds. This held true whether it was a cold start or warm.

So, questions:

  1. Why does my app start slower with serialization assemblies in place?
  2. Is there a way to see via Perfmon or some other tool when the app is generating serialization assemblies?
  3. Am I generating serialization assemblies correctly?
4

2 回答 2

1

您应该分析您的应用程序以了解启动时间增加的原因。Perfview 将是一个很好的工具。

如果在 JITtting 上花费了太多时间,请考虑将 NGEN 作为您的应用程序。如果加载的页面过多,如果您在 .Net 4.5 下运行,请考虑使用 mpgo 优化

于 2012-08-15T03:59:39.710 回答
0

因为 .NET 必须检查签名是否有效

于 2012-08-14T23:47:36.123 回答