64位的性能优势性能、优势

2023-09-07 18:17:06 作者:10.Liar

什么是性能优势的64位应用程序的源有超过32位的应用程序?我假设有性能上的优势,因为像WinRAR的程序做广告。

What is the source of the performance advantage 64-bit applications have over 32-bit applications? I'm assuming there is a performance advantage because programs like WinRAR advertise it.

另外,我们可以得到这些性能优势,只需切换到64位编译程序,还是有在code,它需要做任何更改?

Also, can we get these performance advantages simply by switching to a 64-bit compiler, or are there any changes in code that need to be made?

有关这两个答案,非托管和托管code,是受欢迎的。

Answers related to both, unmanaged and managed code, are welcome.

推荐答案

为了充分利用64位架构的最新CPU的,你必须:

In order to take advantage of the 64 bit architecture of the latest CPU's you have to:

使用64位CPU和OS 专门开发使用的是64位API 64位 - 执行一直走一路下跌到最基本code与CPU寄存器(通常是用汇编写的)合作,采取额外的寄存器的优势。 在开发将真正受益于额外的登记申请 - WinRAR是一个应用程序,将采取额外的寄存器充分利用,因为它涉及到很多微积分的复杂算法。如果你写的,而不是用很简单的算法的应用程序,它不会需要额外的寄存器地址空间,它会更快的64位无法正常工作 也需要考虑到,当你使用一个CPU的寄存器,即使你不使用整个地址空间对于一个数值,它仍然需要尽可能多的空间(= 64位)。所以写在一个小的应用程序64位目标是得到一个优化的code将只是不工作..该应用程序会占用的内存比是否会在32位被开发,它可能会更慢两倍。规划中的64位是有道理的,使用重型算法或需要拨出巨额件内存的应用程序(4GB的限制,32位应用程序)。