5 ms·
As addressed in the comments on SO[1], x32 mode is actually still long mode. It's just a change in ABI to use the upper and lower 2GB of address space so that
by simcop2387 11y ago
As addressed in the comments on SO[1], x32 mode is actually still long mode. It's just a change in ABI to use the upper and lower 2GB of address space so that you can fit pointers in 32bits. It doesn't really act like a 32bit system because it isn't it's a 64bit system with a restricted address space.
That said it can be useful for certain loads where you aren't consuming large amounts of memory but are doing lots of calculations.
[1] http://stackoverflow.com/questions/16841382/what-is-the-performance-impact-of-using-int64-t-instead-of-int32-t-on-32-bit-sys#comment24292419_16841814 http://stackoverflow.com/questions/16841382/what-is-the-perf...
- AnthonyMouse 11y agoI'm surprised it's not more common on small [virtual] machines where the total memory+swap can still be addressed by a 32-bit pointer. 32-bit pointers are much more cache-friendly if you don't need the address space.
- joosters 11y agox32 mode can be a huge win if your data structures contain lots of pointers/references. It can shrink the memory usage and speed up computation by surprising amounts (compared to running the same process in a 'full' 64 bit mode). It's not just for when you are writing your own intricate code, either. An x32 build of perl sped up some of my programs dramatically, and let me run stuff on a 4GB machine that previously couldn't fit the data in. Ubuntu has some x32 packages available for their standard 64 bit distribution, but the selection is limited.
- qb45 11y agoDid you compare x32 versus the old fashioned i386?
- joosters 11y agoNope, other stuff on the machine needed 64 bits so unfortunately it would be difficult to do the comparison. In theory, x32 should still be faster because the code gets to use all the other x64 features, like a larger register set and so on. I've no idea how big a difference that actually would make though.
- qb45 11y agoYou can run 32 bit binaries on 64 bit system. I bet Ubuntu has several 32 bit packages available because they are needed by Wine and and closed-source 32 bit binaries. The theoretical possibility for speedup is exactly why I asked. The x32 website has benchmarks where it's as fast as i386 and 40% faster than amd64 on pointers or as fast as amd64 and 40% faster than i386 on 64 bit math, but what's missing to really justify x32 is some "20% better than either" case.
- Dylan16807 11y agoNot that you need to use x32 to use arena allocation with 32 bit pointers inside it.