将 Windows 应用程序编译为 64 位有什么实际意义吗? [英] Is there any real point compiling a Windows application as 64-bit?

查看:78
本文介绍了将 Windows 应用程序编译为 64 位有什么实际意义吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以自信地说,我们编写的 99% 的应用程序不需要处理超过 2Gb 的内存.当然,运行 64 位的 OS 有很多明显的好处来处理更多的 RAM,但是典型的应用程序有什么特别的理由编译 64 位吗?

I'd confidently say 99% of applications we write don't need to address more than 2Gb of memory. Of course, there's a lot of obvious benefit to the OS running 64-bit to address more RAM, but is there any particular reason a typical application would be compiled 64bit?

推荐答案

64 位可能会带来性能改进.一个很好的例子是函数调用中的一些参数通过寄存器传递(更少的东西压入堆栈).

There are performance improvements that might see with 64-bit. A good example is that some parameters in function calls are passed via registers (less things to push on the stack).

编辑当我研究使用 64 位构建与 32 位构建运行我们的产品时的一些差异时,我查阅了一些旧笔记.我在四核 64 位机器上运行测试.因此,由于 32 位显然是在仿真模式下运行,因此存在将苹果与橙子进行比较的问题.但是,似乎我阅读的很多东西例如, 一直说 WOW64 的速度命中并不显着.但即使该陈述不正确,您的应用程序几乎肯定会在 64 位操作系统上运行.因此,在 64 位机器上比较 32 位版本与 64 位版本是有价值的.

Edit I looked up some of my old notes from when I was studying some of the differences of running our product with a 64-bit build versus a 32-bit build. I ran the tests on a quad core 64-bit machine. So there is the question of comparing apples to oranges since the 32-bit was running under the emulation mode obviously. However, it seems that many things I read such as this, for example, consistently say that the speed hit for WOW64 is not significant. But even if that statement is not true, your application will almost certainly be run on a 64-bit OS. Thus a comparison of a 32-bit build versus 64-bit on a 64-bit machine has value.

在我执行的测试中(当然不全面),我没有发现任何 32 位构建速度更快的情况.然而,当使用 64 位构建运行时,我运行的许多 SQL 密集型操作(高 CPU 和高 I/O)的速度提高了 20% 到 50%.这些测试涉及一些相当丑陋"的 SQL 语句和一些高并发的 TPCC 测试.当然,很大程度上取决于编译器开关,因此您需要进行自己的测试.

In the testing I performed (certainly not comprehensive), I did not find any cases where the 32-bit build was faster. However many of the SQL intensive operations I ran (high CPU and high I/O) were 20% to 50% faster when running with the 64-bit build. These tests involved some fairly "ugly" SQL statements and also some TPCC tests with high concurrency. Of course, a lot depends on compiler switches quite a bit, so you need to do your own testing.

这篇关于将 Windows 应用程序编译为 64 位有什么实际意义吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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