编写基于x64的应用程序。真的有什么意义吗?

时间:2022-09-01 11:24:33

Obviously, it probably has some (or many) advantages over 32-bit that I'm clearly not aware of. So, what are they?

显然,它可能具有超过32位的一些(或许多)优势,我显然不知道。那么,他们是什么?

I just don't get it, so many things still aren't supported on X64 PC's. For example, on Internet Explorer 8 and 9 64-bit versions don't support Flash, and when I manage to get it working, it then UN-works, then brings up a message telling me that 64-bit IE's don't currently support flash or Flash isn't available on 64-bit browsers.

我只是不明白,X64 PC上仍然不支持很多东西。例如,在Internet Explorer 8和9上,64位版本不支持Flash,当我设法让它工作时,然后UN工作,然后显示一条消息,告诉我64位IE目前没有支持Flash或Flash在64位浏览器上不可用。

I have a 64-bit pc now with Windows 7, and am still writing 32-bit apps, and they all work perfectly (minus a few bugs here n there, which would appear whether you're using 32/64-bit). Why should/would one want to develop for 64-bit systems? I don't see how they are any different and, if I were to learn more about developing for 64bit, where would you recommend I start?

我现在有一台带有Windows 7的64位PC,我仍然在编写32位应用程序,它们都运行良好(减去这里的一些错误,无论你使用的是32/64位,都会出现这种情况)。为什么要为64位系统开发?我不知道它们有什么不同,如果我要了解更多关于开发64位的信息,你会在哪里推荐我开始?

3 个解决方案

#1


1  

The most commonly cited reason for 64-bit applications is access to more memory. Database servers, for one obvious example, can benefit tremendously when most (or all) the data they're working with is available in memory instead of being stored on disk.

64位应用程序最常被提及的原因是访问更多内存。数据库服务器,一个明显的例子,当他们使用的大多数(或所有)数据在内存中可用而不是存储在磁盘上时,可以获得极大的好处。

You can also gain extra speed, especially for floating point-intensive applications (I've seen a 3x speed-up fairly routinely, though it also depends somewhat on the CPU).

您还可以获得额外的速度,特别是对于浮点密集型应用程序(我已经看到了相当常规的3倍加速,尽管它在某种程度上取决于CPU)。

Some other applications, however, gain little or even lose some by moving to 64-bits. The CPU still has the same bandwidth to memory, but all your pointers double in size so if you're using pointers a lot, it can end up a net loss.

然而,一些其他应用程序通过移动到64位而获得很少甚至损失一些。 CPU仍然具有与内存相同的带宽,但是所有指针的大小都会增加一倍,所以如果你大量使用指针,它可能会导致净损失。

#2


1  

It depends what you are doing.

这取决于你在做什么。

If you're writing a standalone app that doesn't talk to anything else, isn't going to need a huge amount of memory and wouldn't benefit from the extra registers x64 provides then you won't get much (except bloated structure sizes :)) from making an x64 version.

如果你正在编写一个不与任何其他东西交谈的独立应用程序,不需要大量的内存而且不会受益于x64提供的额外寄存器那么你就不会得到太多(除了膨胀的结构)尺寸:))来自制作x64版本。

OTOH, for code that runs in-process, x64 is kinda viral. The shell itself is 64-bit now so if you want to plug into it you have to be 64-bit as well. (Or at least provide an adapter which can talk to the 64-bit world.) As a result, it's often easier to compile everything as 64-bit so you don't have the hassle of marshalling calls between the two worlds.

OTOH,对于在进程中运行的代码,x64有点病毒。 shell本身现在是64位,所以如果你想插入它,你也必须是64位。 (或者至少提供一个可以与64位世界通信的适配器。)因此,将所有内容编译为64位通常更容易,因此您无需在两个世界之间编组调用的麻烦。

(While still having a 32-bit build for 32-bit OS, of course.)

(当然,仍然有32位操作系统的32位版本。)

Edit: Forgot to say, it's also useful to target x64 if you want to present the "real" view of a machine. 64-bit Windows "lies" to 32-bit processes about various things for compatibility reasons. You can disable/bypass the lies but doing so without breaking things (e.g. 3rd party DLLs) can be tricky and it's best avoided.

编辑:忘了说,如果你想要呈现机器的“真实”视图,它对目标x64也很有用。出于兼容性原因,64位Windows“涉及”各种事物的32位进程。你可以禁用/绕过谎言,但这样做不会破坏事情(例如第三方DLL)可能会很棘手,最好避免。

#3


0  

64-bit software can address more than 4GB of memory (in reality the limit is ~3GB) directly and it uses additional hardware (extra registers, etc.) available on modern CPUs, thus improving performance. These are the two major reasons of the migration to 64 bit.

64位软件可直接处理超过4GB的内存(实际上限制为~3GB),它使用现代CPU上可用的附加硬件(额外寄存器等),从而提高性能。这些是迁移到64位的两个主要原因。

Normally you would develop cross-platform software and your compiler would take care of using all the 64-bit features.

通常,您将开发跨平台软件,您的编译器将负责使用所有64位功能。

#1


1  

The most commonly cited reason for 64-bit applications is access to more memory. Database servers, for one obvious example, can benefit tremendously when most (or all) the data they're working with is available in memory instead of being stored on disk.

64位应用程序最常被提及的原因是访问更多内存。数据库服务器,一个明显的例子,当他们使用的大多数(或所有)数据在内存中可用而不是存储在磁盘上时,可以获得极大的好处。

You can also gain extra speed, especially for floating point-intensive applications (I've seen a 3x speed-up fairly routinely, though it also depends somewhat on the CPU).

您还可以获得额外的速度,特别是对于浮点密集型应用程序(我已经看到了相当常规的3倍加速,尽管它在某种程度上取决于CPU)。

Some other applications, however, gain little or even lose some by moving to 64-bits. The CPU still has the same bandwidth to memory, but all your pointers double in size so if you're using pointers a lot, it can end up a net loss.

然而,一些其他应用程序通过移动到64位而获得很少甚至损失一些。 CPU仍然具有与内存相同的带宽,但是所有指针的大小都会增加一倍,所以如果你大量使用指针,它可能会导致净损失。

#2


1  

It depends what you are doing.

这取决于你在做什么。

If you're writing a standalone app that doesn't talk to anything else, isn't going to need a huge amount of memory and wouldn't benefit from the extra registers x64 provides then you won't get much (except bloated structure sizes :)) from making an x64 version.

如果你正在编写一个不与任何其他东西交谈的独立应用程序,不需要大量的内存而且不会受益于x64提供的额外寄存器那么你就不会得到太多(除了膨胀的结构)尺寸:))来自制作x64版本。

OTOH, for code that runs in-process, x64 is kinda viral. The shell itself is 64-bit now so if you want to plug into it you have to be 64-bit as well. (Or at least provide an adapter which can talk to the 64-bit world.) As a result, it's often easier to compile everything as 64-bit so you don't have the hassle of marshalling calls between the two worlds.

OTOH,对于在进程中运行的代码,x64有点病毒。 shell本身现在是64位,所以如果你想插入它,你也必须是64位。 (或者至少提供一个可以与64位世界通信的适配器。)因此,将所有内容编译为64位通常更容易,因此您无需在两个世界之间编组调用的麻烦。

(While still having a 32-bit build for 32-bit OS, of course.)

(当然,仍然有32位操作系统的32位版本。)

Edit: Forgot to say, it's also useful to target x64 if you want to present the "real" view of a machine. 64-bit Windows "lies" to 32-bit processes about various things for compatibility reasons. You can disable/bypass the lies but doing so without breaking things (e.g. 3rd party DLLs) can be tricky and it's best avoided.

编辑:忘了说,如果你想要呈现机器的“真实”视图,它对目标x64也很有用。出于兼容性原因,64位Windows“涉及”各种事物的32位进程。你可以禁用/绕过谎言,但这样做不会破坏事情(例如第三方DLL)可能会很棘手,最好避免。

#3


0  

64-bit software can address more than 4GB of memory (in reality the limit is ~3GB) directly and it uses additional hardware (extra registers, etc.) available on modern CPUs, thus improving performance. These are the two major reasons of the migration to 64 bit.

64位软件可直接处理超过4GB的内存(实际上限制为~3GB),它使用现代CPU上可用的附加硬件(额外寄存器等),从而提高性能。这些是迁移到64位的两个主要原因。

Normally you would develop cross-platform software and your compiler would take care of using all the 64-bit features.

通常,您将开发跨平台软件,您的编译器将负责使用所有64位功能。