Does C# compiler /optimize command line option affect JITter?

北城余情 提交于 2019-12-07 04:23:05

问题


I've been reading Eric Lippert's article about the /optimize command line option of the C# compiler. The article describes what kind of optimizations the compiler performs. However it remains unclear to me if this option affects JIT optimization as well. It is not unthinkable, that this option would make the compiler to emit some metadata, that jitter can understand to change "optimization mode". Is there any reference that can confirm or otherwise if this option does indeed affect JITter?


回答1:


Is there any reference that can confirm or otherwise if this option does indeed affect JITter?

According to Jeffrey Richter in his CLR via C# book, 3rd edition (chapter 1, page 13), it does. The /optimize+ switch will result in optimizations for C# IL code, as well as the native code generated by the JIT compiler. As to how it actually does that, I'm not sure. My wild guess is that it might have something to do with the CorDebugJITCompilerFlags enumeration.



来源:https://stackoverflow.com/questions/10003672/does-c-sharp-compiler-optimize-command-line-option-affect-jitter

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