Suppress JIT optimization on module load (managed only)

北战南征 提交于 2019-12-04 10:41:42

问题


If I run a release build in VS but WITH debugger attached. So I can set breakpoints and investigate the optimized code disassembly. Usually, in order to see all optimizations I need to run WITHOUT a debugger attached and detach to the running proccess.

Does unselecting the "Suppress JIT optimization on module load (managed only)" switch in Visual Studio is sufficient to bring the same result? By 'same result' I mean: same (optimized) machine instructions as by starting without debugger attached?

I heard the JIT compiler would only utilize ALL optimization options, if the assembly was a release build and NO debugger was attached. Now I wonder if this switch could make my debugging / inspecting live easier?


回答1:


There is small differences in IL between DEBUG and RELEASE builds, so you do want to use RELEASE build in this case (i.e. all Debug.XXX calls are compiled out in Release case).

Un-checking "Suppress JIT optimization on module load (managed only)" should allow JIT do do optimizations as if no debugger attached. I'm not aware of any differences between these 2 cases.



来源:https://stackoverflow.com/questions/9564739/suppress-jit-optimization-on-module-load-managed-only

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