在什么级别的C#编译器或JIT优化应用程序code? [英] At what level C# compiler or JIT optimize the application code?

查看:186
本文介绍了在什么级别的C#编译器或JIT优化应用程序code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这个信息,以减少我的code尺寸的,所以我不会浪费我的时间优化的东西会被编译或JIT来完成。

I want to know this info to reduce my code size so I will not waste my time optimize things that will be done by compiler or JIT.

例如:

如果我们假设编译器内嵌调用属性的get函数,所以我没有保存返回值在一个局部变量,以避免函数调用。

if we assume the compiler inline the call to the get function of a property so I do not have to save the return value in a local variable to avoid function call.

我想推荐一个很好的参考,它描述到底是怎么回事?

I want to recommend a good reference that describes what is going on?

推荐答案

您可能想看看这些文章:

You may want to take a look at these articles:

JIT优化 - (萨沙Goldshtein - $ C $的CProject)
JIT优化:内联我(大卫Notario)
JIT优化:内联二(大卫Notario)

JIT Optimizations - (Sasha Goldshtein - CodeProject)
Jit Optimizations: Inlining I (David Notario)
Jit Optimizations: Inlining II (David Notario)

说实话,你不应该过分担心微这样的详细程度。让这个为你的编译器/ JIT'er担心,这是它比您在几乎所有情况下。不要急于选择 premature优化。专注于让你的code工作,那么不用担心以后的优化上,如果(一)不运行速度不够快,(B)你有'大小'的问题。

To be honest you shouldn't be worrying too much about this level of micro-detail. Let the compiler/JIT'er worry about this for you, it's better at it than you are in almost all cases. Don't get hung up on Premature Optimisation. Focus on getting your code working, then worry about optimisations later on if (a) it doesn't run fast enough, (b) you have 'size' issues.

这篇关于在什么级别的C#编译器或JIT优化应用程序code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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