What is the difference between Start Debugging and Attach to Process

眉间皱痕 提交于 2019-12-06 05:05:38

问题


My project loads significantly faster when I attach it to my w3wp.exe IIS worker process, than when I "Start Debugging".

However, the same worker process seems to be processing the same amount of modules/DLLs (w3wp.exe) whether I "Start Debugging" or "Attach to Process".

Why is attaching to a process so much quicker?


回答1:


"Start Debugging" launches a new instance of the executable with the debugger attached right from the beginning, so the overhead of all the needed debugger calls is incurred from launch, whereas "Attach to Process" attaches to a already running process, so until then your process was running without any additional overhead caused by debugging.




回答2:


The code without debugging performs much for faster. When you attach the process the application is already started, pool is started, so you do not perform some heavy operations in debug mode, for example Application_OnStart event and some others.



来源:https://stackoverflow.com/questions/11564026/what-is-the-difference-between-start-debugging-and-attach-to-process

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