Do external references slow down my ASP.NET application? (VS: Add Reference dialog)

十年热恋 提交于 2019-12-11 06:44:42

问题


I've noticed as my website gets bigger and bigger, the time my laptop takes to display my page is much longer then say a new projects with minimal references.

I think there are two variables at play that affect ASP.NET warm-up time:

  • The quantity of external references
  • The time it takes for a worker process to new() up each instance per worker process
  • Additional time for the WCF objects as the ServiceHost may be in an external DLL

First, are those the correct variables to take into account when considering ASP.NET startup time?

Next, it appears that web.config may dispatch other objects for use with certain filetypes (*.svc, *.aspx, Windows Identity Foundation (WIF), etc. ). This too may cause delays in ASP.NET.

Last, my project is created as a "web project" not a "web site". Not sure if this has an impact.

Is my theory full of holes, or is there something I can do to make development on a old laptop any better?


回答1:


The worker process will load any references into the AppDomain as they are needed. This means when the application first starts up not all of your referenced assemblies may be loaded. If you are finding a lot of your bootstrapping time (the initial application start up time) is increasing, I would consider looking at exactly what you are doing in your Application_Start method, etc. The other thing to remember, is that this initial startup time is essentially a one off, it will only occur for each application startup (don't forget when your application pool gets recycled too). Because it is a one time thing, does the start up time matter? Once the site has had its initial page view, execution from that point onwards should be quite speedy.

You could run something like ANTS Profiler, or dotTrace and profile exactly where all the time is being spent, and then decide what performance improvements you wish to make based on that information.



来源:https://stackoverflow.com/questions/3424375/do-external-references-slow-down-my-asp-net-application-vs-add-reference-dial

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!