什么属性有助于运行时.Net性能?

Lar*_*ens 14 .net performance runtime

我正在寻找可以通过给加载器,JIT编译器或ngen提供提示来确保我的.Net应用程序的最佳运行时性能的属性.

例如,我们有DebuggableAttribute,应设置为不调试,不禁用优化以获得最佳性能.

[Debuggable(false, false)]
Run Code Online (Sandbox Code Playgroud)

还有其他我应该知道的吗?

Tho*_*ker 5

Ecma-335在附件F"不精确的故障"中为轻松的异常处理(所谓的电子放松呼叫)指定了更多的CompilationRelaxations,但它们并未被微软公开.

特别提到CompilationRelaxations.RelaxedArrayExceptions和CompilationRelaxations.RelaxedNullReferenceException.

当您在CompilationRelaxationsAttribute的ctor中尝试一些整数时会发生什么事情;)