4 ms·
The author states: >"The x32 ABI allows for making use of the additional registers and other features of x86_64 but with just 32-bit pointers in order to provi
by bogomipz 8y ago
The author states:
>"The x32 ABI allows for making use of the additional registers and other features of x86_64 but with just 32-bit pointers in order to provide faster performance when 64-bit pointers are unnecessary."
Can someone say why would 32 bit pointers provide faster performance then 64 bit on modern hardware? Is this performance difference really non-negligible?
- jabl 8y ago> Can someone say why would 32 bit pointers provide faster performance then 64 bit on modern hardware? Is this performance difference really non-negligible? With narrower pointers your memory & caches becomes effectively bigger, as well as memory and cache bandwidth.
- danieldk 8y agoMaybe fewer cache misses in pointer-heavy data structures?
- geocar 8y ago"Negligible" means different things to different people. There's a benchmark floating around that saw 13% boost for some operations. That could mean saving an hour or more of compute time for some of my applications. The reason why it's faster is because your program is smaller, and your data is smaller, and that means a better (more efficient) use of the on-CPU cache.
- Slartie 8y ago64 bit pointers require double the space in memory, hence your caches inside the processor can only hold half the number of pointers. This means more cache misses and thus more waiting for abysmally slow (when compared with L1/L2 caches) RAM. The impact of this is AFAIK generally in the single-digit percentage area, but if you have an algorithm that just fits everything into the caches with 32 bit pointers, the change to 64 bit pointers might push it over the edge, which can then result in significant (>= double-digit percentage) performance decrease.
- jgowdy 8y agoIt’s simple. Pointer sizes being twice as big consume twice as much cache, thus you’re effectively cutting your cache size in half (worst case, if the cache line were stuffed end to end with pointers). I imagine the idea that cutting the cache size by up to 50% causes a severe performance impact doesn’t require much explanation.
- floatboth 8y ago> effectively cutting your cache size in half Only if the cache is full of pointers, and not the numbers you're crunching :)