提供软件的64位特定版本 [英] Supplying 64 bit specific versions of your software

查看:197
本文介绍了提供软件的64位特定版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我会希望看到任何性能增益建立我的本地C ++客户端和服务器到64位code?

Would I expect to see any performance gain by building my native C++ Client and Server into 64 bit code?

什么样的​​应用程序由具有64位特定的构建中受益?

What sort of applications benefit from having a 64 bit specific build?

我想像任何广泛使用的长期受益,或需要大量的内存(即超过2GB)的任何应用程序,但我不知道还有什么。

I'd imagine anything that makes extensive use of long would benefit, or any application that needs a huge amount of memory (i.e. more than 2Gb), but I'm not sure what else.

推荐答案

英特尔的x64与x86的架构优势

  • 在更大的地址空间
  • 更丰富的寄存器组
  • 可以防止外部库或加载插件是64位
  • 链接

基于x64模式下的建筑下行

  • 所有指针(因此许多指令太)占用2倍的存储器,切割有效处理器高速缓存的大小的一半,在最坏的情况下
  • 在不能对外部库或加载插件,是32位
  • 链接

在应用中我写的,我有时会切换到64位,当看到大的加速(30%),有时可见大的减速(> 2倍)。最大的加速比都发生在数字运算/视频处理应用我在那里注册绑定。

In applications I've written, I've sometimes seen big speedups (30%) and sometimes seen big slowdowns (> 2x) when switching to 64-bit. The big speedups have happened in number crunching / video processing applications where I was register-bound.

转换为64位时,我看到在我自己的code的唯一的大衰退是其中一个编译器做了一些非常糟糕的优化一个巨大的指针追逐的应用程序。另一种编译器生成的code,其中的性能差异可以忽略不计。

The only big slowdown I've seen in my own code when converting to 64-bit is from a massive pointer-chasing application where one compiler made some really bad "optimizations". Another compiler generated code where the performance difference was negligible.

效益,现在移植的

写作64位兼容的code并不难99%的时间,一旦你知道该怎么注意。最主要的是,它归结为引用的内存地址时,(我假设C / C ++ code在这里),使用整型的size_t和ptrdiff_t型代替。它可以是一个痛苦的转变了很多,这不是写的是64位感知code。

Writing 64-bit-compatible code isn't that hard 99% of the time, once you know what to watch out for. Mostly, it boils down to using size_t and ptrdiff_t instead of int when referring to memory addresses (I'm assuming C/C++ code here). It can be a pain to convert a lot of code that wasn't written to be 64-bit-aware.

即使它没有任何意义,使64位构建您的应用程序(也可能不会),这是值得花时间去学习怎样才能使构建这样至少所有新的code和未来的重构将是64位兼容的。

Even if it doesn't make sense to make a 64-bit build for your application (it probably doesn't), it's worth the time to learn what it would take to make the build so that at least all new code and future refactorings will be 64-bit-compatible.

这篇关于提供软件的64位特定版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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