为 64 位编译我的应用程序如何使其更快或更好? [英] How can compiling my application for 64-bit make it faster or better?

查看:22
本文介绍了为 64 位编译我的应用程序如何使其更快或更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 C#、.NET、VS.NET 2008.

I use C#, .NET, VS.NET 2008.

除了能够处理更多内存之外,将我的应用程序编译为 64 位还有什么优势?

Besides being able to address more memory, what are the advantages to compiling my application to 64-bit?

它会更快还是更小?为什么?

Is it going to be faster or smaller? Why?

它是否使它与 x64 系统更兼容(与 32 位应用程序相比)?

Does it make it more compatible with a x64 system (when compared to a 32-bit application)?

推荐答案

对于本机 应用程序,您可以获得诸如增加地址空间之类的好处.然而,.NET 应用程序在 CLR 上运行,它抽象了任何底层架构差异.

For native applications, you get benefits like increased address space and whatnot. However, .NET applications run on the CLR which abstracts away any underlying architecture differences.

假设您只是在处理托管代码,那么针对特定平台没有任何好处;您最好只使用anycpu"标志集(默认情况下处于启用状态)进行编译.这将生成与平台无关的程序集,这些程序集可以在 CLR 运行的任何架构上同样良好地运行.

Assuming you're just dealing with managed code, there isn't any benefit to targeting a specific platform; you're better off just compiling with the "anycpu" flag set (which is on by default). This will generate platform agnostic assemblies that will run equally well on any of the architectures the CLR runs on.

专门针对(比如说)x64 不会给您带来任何性能提升,并且会阻止您的程序集在 32 位平台上运行.

Specifically targeting (say) x64 isn't going to give you any performance boost, and will prevent your assemblies from working on a 32-bit platform.

这篇文章有更多关于主题.

更新: Scott Hanselman 刚刚发布了一个很好的概述也是这个话题.

Update: Scott Hanselman just posted a good overview of this topic as well.

这篇关于为 64 位编译我的应用程序如何使其更快或更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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