开发者

Does .Net / C#'s speed degrade with increased field depth?

Is t开发者_StackOverflow社区here any execution speed difference between the following two lines of code? I cannot tell from looking at the IL:

int x = MainObject.Field1;
int x = MainObject.Public.Fields.Field1;

I know from Delphi (native code), there is no difference.


Accesing by '.' to deeper class structure elements - NO, but method invocation with it - YES.


There is no difference whatsoever. (assuming you mean, as you say in the title, fields)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜