使用/optimize +编译器选项时,C#编译器会执行哪些优化? [英] What optimizations does the C# compiler perform when you use the /optimize+ compiler option?

查看:114
本文介绍了使用/optimize +编译器选项时,C#编译器会执行哪些优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您使用/optimize +编译器选项时,C#编译器会执行哪些优化?

What optimizations does the C# compiler perform when you use the /optimize+ compiler option?

推荐答案

据我所知,C#代码优化被简化为通用的CLI常见的代码优化.显然,这取决于CLI的版本.请参阅:
http://www.drdobbs.com/net-code-optimization/184416840 [ ^ ].

这是有关JIT优化的有趣的CodeProject文章: JIT优化 [
As far as I know, C# code optimization is reduced to the general code optimization common for CLI. Apparently, it depends on the version of CLI. Please see:
http://www.drdobbs.com/net-code-optimization/184416840[^].

This is an interesting CodeProject article on JIT optimization: JIT Optimizations[^].

—SA


有两个影响代码优化的C#编译器开关:/optimize和/debug.
下面将显示这些开关对C#编译器生成的IL代码的质量和JIT编译器生成的本机代码的质量的imapact.

编译器开关设置:说明
--------------------------------------
/optimize-/debug-:未优化"C#IL代码质量",并且已优化"JIT本机代码质量".

/optimize-/debug(+/full/pdbonly):未优化"C#IL代码质量",未优化"JIT本机代码质量".

/optimize +/debug(-/+/full/pdbonly):优化了"C#IL代码质量",并且优化了"JIT本机代码质量".
There are two C# compiler switches that impact code optimization: /optimize and /debug.
The following will shows the imapact these switches have on the quality of the IL Code generated by the C# compiler and the quality of the native code generated by the JIT compiler

Compiler Switch Settings : Description
--------------------------------------
/optimize- /debug- : "C# IL code Quality" is UnOptimized and "JIT Native Code Quality" is optimized.

/optimize- /debug(+/full/pdbonly) : "C# IL code Quality" is UnOptimized and "JIT Native Code Quality" is Unoptimized.

/optimize+ /debug(-/+/full/pdbonly): "C# IL code Quality" is Optimized and "JIT Native Code Quality" is optimized.


这篇关于使用/optimize +编译器选项时,C#编译器会执行哪些优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆