.Net / C# 的速度会随着景深的增加而降低吗?

发布于 2024-09-27 07:28:08 字数 163 浏览 2 评论 0原文

下面两行代码执行速度有区别吗?我无法通过查看 IL 来判断:

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

我从 Delphi(本机代码)知道,没有区别。

Is there 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘虞初梦 2024-10-04 07:28:08

通过“.”访问更深入的类结构元素 - 否,但使用它的方法调用 - 是。

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

失眠症患者 2024-10-04 07:28:08

没有任何区别。 (假设你的意思是,正如你在标题中所说的,字段)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文