Ubuntu 12.10: 32-bit vs. 64-bit Linux Performance
Phoronix: Ubuntu 12.10: 32-bit vs. 64-bit Linux Performance
In past years on Phoronix there has been no shortage of 32-bit vs. 64-bit Linux benchmarks. Assuming you don't have a limited amount of RAM and under memory pressure, 64-bit distributions tend to be much faster than the 32-bit versions. However, some Linux users still often wonder whether they should use the 32-bit or 64-bit version of their distribution even when on 64-bit hardware. So with that said, here's some more 32-bit vs. 64-bit benchmarks of Ubuntu 12.10 with the Linux 3.5 kernel.
Hi Michael, I just thought of an improvement to your graphs: Instead of just writing "More is Better/Less is Better" you could make the "winning" graph a slighly different color, for instance brighter and more saturated. That would give the user instant feedback on which one won a test (when numbers aren't as important).
Is it theoretically possible for 32 bit to be superior to 64 bit for some workloads, and if so, what kinds? Or, if not, should we file bugs on software packages whose performance regresses when compiled for 64 bit?
64bit in itself will only help an algorithm if data structures larger than 32bit are used, or could be used to increase performance.
This is especially true for applications that need more than 4GB of RAM (forget PAE, it is slower).
Now what happened to the x86 world is that with the introduction of AMD64 (x86-64 extension) the registers did not only get wider but doubled!
Integer registers and SIMD registers. The latter recently even quadrupled (AVX).
Apart from that the 64bit mode offers new ways of addressing code, relative to the instruction pointer.
And maybe more I'm not aware of.
Also there have been loads of additions to the x86 instruction set since AMD64 was introduced in 2003 (Intel implemented it a bit later). I don't know if some of these additions can only be used in 64bit mode. If so, they add to the potential performance gain for 64bit software.
But if your algorithm just can not be improved via wider registers more registers or other voodoo, it is probably faster on a 32bit CPU. This is because full 64bit operations take probably more time to compute (transistor latency) and compressing 32bit (and often much smaller) numbers such that they do not waste 80% (or so, on average) of the available 64bit registers/computational units is pretty slow, if even attempted.
Therefore I conclude that if programmed wisely or at least put through a great compiler most software should be faster on a modern 64bit CPU. But there are algorithms that just don't scale. Maybe those could be exchanged for better ones, maybe not.
Filing a bug could make the programmer think about optimizations. But don't spam with those ;-)
Originally Posted by enteon
very nice post with great info. love it.
my concern is that we (specially i) develop and write applications in high-level languages.
so i generally don't concern with the no of 'registers' or 'integer size' etc.
isn't it the concern of the compiler that i am using ?
shouldn't it optimize the binary for me for 32bit and 64bit ?
Yeah sure, 64bit is better in some aspects than 32bit...but the opposite is also true.
In the end i will prefer always 32bit for compatibility issues with games....i had a bad enough experience with 64bit in a recent past to even consider it any time soon...
If a piece of software uses pointers heavily (memory addresses for the uninitiated), there is a strong possibility it will run faster on 32 bit hardware. Because on 64 bit addresses are twice as long, therefore 'harder' to access. Techniques have been developed to use 32 bit pointers on 64 bit hardware when addressing less than 4GB, but even their use is slower than direct 32 bit access.
Originally Posted by ethana2
and you have some sources for that claim? because I read it here first....
and please - whoever mentioned x32 - forget it. As fast as you can. It was created by Intel to make Atom suck a bit less. Breaking all and everything just to make a crap CPU look better is NOT a good thing to do.
...and you have some sources for that claim?
Originally Posted by energyman
If you want to deal with the large memory footprint of a native 64bit application you're certanly welcome.
But i'd rather prefer X32 abi and my cpu cache to be used better, instead.
Said that, Not only the benchmark compared 32 vs 64bit here, but even two different instruction sets.
A more fair comparision would be the same application compiled for the amd64 instruction set running on a 64bit and a 32bit kernel.