Supplying 64 bit specific versions of your software

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

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

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.

Answers


Architectural benefits of Intel x64 vs. x86

  • larger address space
  • a richer register set
  • can link against external libraries or load plugins that are 64-bit

Architectural downside of x64 mode

  • all pointers (and thus many instructions too) take up 2x the memory, cutting the effective processor cache size in half in the worst case
  • cannot link against external libraries or load plugins that are 32-bit

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.

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.

Benefit of porting now

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.

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.


Need Your Help

Publish JavaDoc on Jenkins with maven

maven jenkins javadoc

I have maven project that is built by Jenkins-CI.

Create timer with boost::asio

c++ boost boost-asio

I want to create periodic task that perform 1 time per second. But in my case boost::asio::deadline_timer should not be global variable.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.