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.
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?
Answers related to both, unmanaged and managed code, are welcome.
In order to take advantage of the 64 bit architecture of the latest CPU's you have to:
The x64 architecture doubles the number of general purpose registers available in the x86 architecture, so that compilers are able to keep more data in (very fast) CPU registers rather than in (relatively slow) RAM.
When did they stop lying in ads? Did I miss something? ;-)
The major performance advantage is that in 64bit systems, you can allocate more than 4GB of RAM (actually on most systems that's more 2GB) without swapping. That's a huge speed advantage if you need it.
So 64bit gives an advantage if you have applications that need lots of RAM (image/video/audio processing, world/universe simulations).
On top of that, the 64bit CPUs also have commands that operate on 64bit data types (so you don't need to emulate those with 32bit types). That's also an advantage but it's a) not that big because you the algorithms need to use those types and most don't b) they are still slower then 32bit types (but faster than the emulation).
To give you an idea, here is an old joke from a supercomputer guy: "It takes one day to load the data from disks, then the program takes five minutes to process the data and then we need another day to save the result to disk". Reading data from RAM is between 1000 and 1000000 times faster than an access to disk.
So all in all, for the average user, a 64bit system has little to no advantage.
My understanding is that in most circumstances, there is no performance gain as such, apart from the ability to use more memory. (Although it might give higher performance if you're working with 64-bit data types a lot, for example).
Some great answers here.
As was said, you can access unlimited RAM, which will help performance if you need it.
I would humbly add that if you don't need it, but use it anyway, it will hurt performance.
Never lose sight of one of the oldest laws of science: