How can compiling my application for 64-bit make it faster or better?

后端 未结 5 2165
小鲜肉
小鲜肉 2020-12-10 03:45

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

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

Is it going to be fas

5条回答
  •  轮回少年
    2020-12-10 04:03

    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.

    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.

    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.

    This article has a bit more information on the subject.

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

提交回复
热议问题