32位应用程序在64位OS上运行得更快还是更慢? [英] Do 32bit apps run faster or slower on a 64bit OS?

查看:757
本文介绍了32位应用程序在64位OS上运行得更快还是更慢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我主要在32位嵌入式系统上工作,在该系统上,使用本机32位类型(int,float)通常比16位等效类型要快.速度下降的原因是处理器在对其执行操作之前将任何16位数字扩展到了32位.

I've mostly worked on 32bit embedded systems where it was generally faster to use native 32bit types (int, float) than the 16bit equivalents. The slowdown came from the processors expanding any 16bit number to 32bit before performing operations on it.

现在,我已移至PC和64位操作系统.我的问题是-32位类型是否会导致64位计算机上的速度下降?

Now I've moved to PC's and the 64bit OS. My question is - do 32bit types cause any slowdown on 64bit machines?

例如,如果我将MyApp.exe构建为32位应用程序,它将在64位OS上运行得更慢还是更快?

For example if I build MyApp.exe as a 32 bit application, will it run slower on a 64bit OS or faster?

我了解应用的性能涉及很多因素,因此我特意排除了这些因素(IO速度,更快的内存等).

I understand that there are many factors involved in performance of an app and I'm deliberately excluding those factors from the question (IO speed, faster memory etc).

推荐答案

有时32位应用程序运行得更快,有时运行得更慢.有很多竞争因素会影响性能.通常,两个方向的差异不是很大.

Sometimes 32-bit applications run faster, sometimes they run slower. There are a lot of competing factors affecting the performance. Generally the difference in either direction isn't very large.

我看不到如何从性能考虑因素中合理排除任何因素,因为性能总是发生在所有因素都在起作用的现实世界中.速度不是理论上的,不能孤立对待.

I don't see how you can legitimately exclude any factor from performance considerations, because performance always happens in the real world where all factors are in play. Speed is not theoretical and cannot be treated in isolation.

此处是作者进行一些基准测试的文章:

Here is an article where the author did some benchmarking:

http://www.osnews.com/story/5768

他发现32位二进制文​​件的测试速度更快.那是在2004年初的SPARC.

He found that the 32-bit binaries were faster in his tests. That was on SPARC in early 2004.

这是英特尔在2010年发表的一篇文章,介绍了如何转向64位应用程序:

Here is a 2010 article from Intel about moving to 64-bit applications:

http://software.intel.com/zh-CN/articles/moving-from-32-bit-applications-to-64-bit-applications-en/

根据本文,64位二进制文​​件可以为您提供更快的数学运算,因此,如果正确优化,则具有大量数学运算的代码应该更快.否则,您的64位代码可能会变慢,特别是因为它占用更多的内存,并且这可能会导致更多的时间花费在访问RAM上(更频繁的高速缓存未命中).

According to this article, 64-bit binaries can giver you faster math, so math-heavy code should be faster if correctly optimized. Otherwise, your 64-bit code may well be slower, particular since it takes more memory and this may result in more time spent accessing RAM (more frequent cache misses).

这篇关于32位应用程序在64位OS上运行得更快还是更慢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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