什么是/优化C#编译器键? [英] What is /optimize C# compiler key intended for?

查看:149
本文介绍了什么是/优化C#编译器键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有完整的 /优化C#编译器密钥

编辑:
为什么默认禁用?
是否值得在现实世界的应用程序中使用?
- 默认情况下仅在Debug配置中禁用,在Release中启用。

Why is it disabled by default? Is it worth using in a real-world app? -- it is disabled by default only in Debug configuration and Enabled in Release.

推荐答案

Scott Hanselman有一篇博客文章一些例子:什么/ optimize(在Release Builds中启用)。

Scott Hanselman has a blog post that shows a few examples of what /optimize (which is enabled in Release Builds) does.

作为一个总结:/ optimize有很多事情没有给出确切的数字或定义,一个更可见的是方法内联(如果你有一个方法A()调用B()调用C()调用D(),编译器可以跳过B和C,直接从A到D) ,这可能会在Release版本中导致一个怪异的调用堆栈。

As a summary: /optimize does many things with no exact number or definition given, but one of the more visible are method inlining (If you have a Method A() which calls B() which calls C() which calls D(), the compiler may "skip" B and C and go from A to D directly), which may cause a "weird" callstack in the Release build.

这篇关于什么是/优化C#编译器键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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