What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?

自闭症网瘾萝莉.ら 提交于 2019-12-10 13:17:28

问题


What are the actual performance differences between Int64 and Int32 on 32 and 64 bit MS Windows?

It would also be great to see some actual timings of Int64 vs Int32 on each of the two operating system variants. XP or Vista would also be interesting.

  • See also this question about memcpy performance.

回答1:


As far as hardware, Int64 will be more efficient on an x64 and IA64 than x86 because the 64-Bit processors have 64-Bit registers to perform the operations on them.

Int32 will be equally as efficient on all x86, x64, and IA64.

On an x64 and on an IA64 both Int32 and Int64 are equally as efficient.

On an x86 Int32 will be more efficient than an Int64.

As far as the OS itself, I don't think you will see any extra performance issues than the performance results mentioned above.




回答2:


When in doubt, go with the int32. Not only is it faster on x86 architectures, and plenty of those are sitll around, but remember that your cache is finite, and you can fit twice as many int32 into your CPU cache as int64.




回答3:


You may wish to follow SpankyJ's past entries on 64-bit development

http://blogs.msdn.com/joshwil/archive/2005/04/28/413320.aspx




回答4:


From the hardware point of view, ie if the OS takes full advantage of the architechture, the Int64 will be more efficient on a 64 bit system.

Int32 may be slightly more efficient on a 32 bit system, since the 64 bit system may have to emulate the 32 bit operation.



来源:https://stackoverflow.com/questions/281590/what-are-the-actual-performance-differences-between-int64-and-int32-on-32-and-64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!