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

发布于 2024-10-02 23:27:29 字数 376 浏览 0 评论 0原文

显然,它可能比 32 位有一些(或许多)优势,但我显然没有意识到。那么,它们是什么?

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

我现在有一台运行 Windows 7 的 64 位电脑,并且仍在编写 32 位应用程序,它们都运行得很好(除了这里和那里的一些错误,无论您使用的是 32/64 位,这些错误都会出现)。为什么应该/愿意为 64 位系统进行开发?我不明白它们有什么不同,如果我要了解有关 64 位开发的更多信息,您会建议我从哪里开始?

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

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

木森分化 2024-10-09 23:27:29

64 位应用程序最常被提及的原因是可以访问更多内存。举一个明显的例子,当数据库服务器正在使用的大多数(或全部)数据都可以在内存中而不是存储在磁盘上时,数据库服务器可以受益匪浅。

您还可以获得额外的速度,特别是对于浮点密集型应用程序(我经常看到 3 倍的加速,尽管这在一定程度上也取决于 CPU)。

然而,其他一些应用程序通过迁移到 64 位,几乎没有获得任何好处,甚至会损失一些。 CPU 仍然具有相同的内存带宽,但所有指针的大小都会加倍,因此如果您大量使用指针,最终可能会造成净损失。

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.

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).

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.

江湖正好 2024-10-09 23:27:29

这取决于你在做什么。

如果您正在编写一个独立的应用程序,它不与其他任何东西通信,不需要大量的内存,并且不会从 x64 提供的额外寄存器中受益,那么您不会得到太多(除了臃肿的结构)尺寸 :)) 制作 x64 版本。

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

(当然,仍然有针对 32 位操作系统的 32 位构建。)

编辑:忘了说,如果您想呈现机器的“真实”视图,以 x64 为目标也很有用。出于兼容性原因,64 位 Windows 在各种问题上向 32 位进程“撒谎”。您可以禁用/绕过谎言,但在不破坏某些东西(例如第 3 方 DLL)的情况下这样做可能会很棘手,最好避免这样做。

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.

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.

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

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.

感受沵的脚步 2024-10-09 23:27:29

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

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

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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文