I suppose I'm focused on x86, but I'm usually interested in switching from 32 to 64 bits.
Logically, I see that constants and pointers, in some cases, will be larger, so programs are likely to be larger. And the desire to allocate memory at word boundaries for efficiency will mean more gaps between the selections.
I also heard that 32-bit mode on x86 should clear its cache when switching contexts due to possible overlapping 4G address spaces.
So what are the real benefits of 64-bit?
And as an additional question, is 128 bit even better?
Edit:
I just wrote my first 32-bit program. It makes linked lists / trees from 16-byte version (32b) or 32-byte (64-bit version) objects and does a lot of printing on stderr - not a very useful program, and not something typical, but this is my first one.
Size: 81128 (32b) v 83672 (64b) - so no big difference
Speed: 17 s (32b) v 24s (64b) - works on a 32-bit OS (OS-X 10.5.8)
Update:
I note that a new hybrid x32 ABI (Application Binary Interface) is being developed, which is 64b but uses 32b pointers. For some tests, this leads to smaller code and faster execution than 32b or 64b.
https://sites.google.com/site/x32abi/
performance 64bit 32-bit 128bit
philcolbourn Mar 04 '10 at 10:20 2010-03-04 10:20
source share