Page 2 of 2
Re: x86 vs x64
Posted: Tue Apr 08, 2025 11:43 am
by NicTheQuick
Psychophanta wrote: Tue Apr 08, 2025 11:28 am
@NicTheQuick
Agree about windows is stupid, not agree it is the only stupid thing
By the way, i use 32bit linuxes, and it is much better because old stuff compatibility.
I still not found real solid advantages for 64bit, sincerely.
If you only work with old stuff, this might be true.
But to interact with current things, you usually only find 64 bit libraries pre-installed or available in the package manager.
And as soon as you need a good amount of memory you are basically forced to use 64 Bit.
So the advantage I see is that 32 Bit libraries are quite rare nowadays and you mostly find 64 Bit libraries, especially on Linux and Mac systems.
Re: x86 vs x64
Posted: Tue Apr 08, 2025 11:46 am
by Caronte3D
I use the 32-bit compiler for one thing only: maintaining old code (actually, creating DLLs for older programs).
I don't think anyone should use 32-bit compilation today for new programs that don't depend on outdated libraries.
Re: x86 vs x64
Posted: Tue Apr 08, 2025 11:54 am
by dige
Interesting discussion of principles. I had understood Aizo quite differently. I thought it was about if a user software offers a 32 bit and a 64 bit version, which one should be preferred under Windows?
Re: x86 vs x64
Posted: Tue Apr 08, 2025 11:57 am
by NicTheQuick
Regarding the 64-bit advantages besides just raw memory amount, there are quite a few other things that make 64 the way to go:
- Address Space Fragmentation: Even if you don't use more than 2GB RAM, the 32-bit address space itself is tiny (just 2 or 3GB virtual). When you load/unload stuff or allocate memory a lot, this space gets chopped up (fragmented). Eventually, you might need a bigger continuous chunk of address space, but only small scattered pieces are left, causing allocation failures even with 'enough' free RAM overall. The massive 64-bit address space basically eliminates this problem.
- Wider Registers (Crypto/DBs): The CPU registers themselves are 64 bits wide. This means math with large numbers (like 64-bit integers) is native and much faster. Think things like cryptographic hashing, handling huge database IDs or large file offsets – they often benefit directly from single-instruction 64-bit operations instead of needing multiple steps like on 32-bit.
- More Efficient Calling Convention: How functions pass data to each other is more efficient. On 64-bit, parameters are more often passed directly via fast CPU registers instead of being pushed onto the slower memory stack (like often happens in 32-bit). This makes function calls generally faster.
- Modern CPU Instructions (SIMD): You get better access to newer, powerful CPU instruction sets like AVX/AVX2 (SIMD stuff). These process lots of data in parallel and give massive speedups for things like video/audio processing, scientific computing, AI, etc. Compilers often make better use of these in 64-bit mode, or they might only be available there.
- Better ASLR Security: Security features like ASLR (Address Space Layout Randomization) work much better. ASLR randomizes where parts of the program are loaded in memory to make exploits harder. With the enormous 64-bit address space, there are way more possibilities for randomization, making it significantly harder for attackers to guess locations compared to the cramped 32-bit space.
Disclaimer: Yes, that text was created together with Gemini 2.5 Pro (Experimental) because I was just too lazy to write everything in English by myself.