简体   繁体   English

如何测量应用程序加载所有使用的程序集所花费的时间?

[英]How to measure time it took an application to load all used assemblies?

I'm trying to find out why a big WebForms application is starting up slowly (sometimes 2+ minutes). 我试图找出为什么大型WebForms应用程序启动缓慢(有时需要2分钟以上)的原因。
I suspect slow start has to do with lots of assemblies it loads up (about 50 NuGet packages + compiled ASPX pages), but I'm not sure. 我怀疑启动速度慢与加载的程序集有关(大约50个NuGet包+编译后的ASPX页),但是我不确定。 How do I measure how much time it took the CLR to load all assemblies? 如何测量CLR加载所有程序集所花费的时间?
I tried both dotTrace and ants profiler, haven't found that metric. 我尝试了dotTrace和ant profiler,但没有找到该指标。
I heard about profiling API , but it's my understanding it's native only - and I'm far from C++ expert. 我听说过概要分析API ,但是据我了解,它仅是本机的-而且我离C ++专家还很远。

If you want to be able to view logs that show you assemblies loading and binding, the tool you are looking for is fusion logs . 如果您希望能够查看显示程序集加载和绑定的日志,那么您所寻找的工具是融合日志 Normally you use Fusion to log bind failures, but you can set it to "Log all binds to disk" to log everything. 通常,您使用Fusion记录绑定失败,但可以将其设置为“将所有绑定记录到磁盘”以记录所有内容。 Turn those on and inspect the timestamps to see if anything is taking a long time to load. 将它们打开,检查时间戳记,看是否有任何东西需要很长时间加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM