Are there benefits to running X86-64 Python on a 64-bit CPU in a 64-bit OS? Are there benefits to running X86-64 Python on a 64-bit CPU in a 64-bit OS? python python

Are there benefits to running X86-64 Python on a 64-bit CPU in a 64-bit OS?


The primary rationale to use a 64-bit Python is that you can access more than 2GB of main memory, e.g. if you have large dicts, lists, or long strings. This requires that you actually have that much memory in your system to be practical.

A secondary effect is that in AMD64 mode, the CPU has more registers, so the resulting code may run slightly faster (for integer operations).

Python in 64-bit mode on Windows certainly is not beta or unsupported. It may be buggy, but only if you actually do have very large data structures. 64-bit Python has been around 15 years (though not on Windows).


Same advantage as every other 64-bit program: lots of process space, and access to more and larger registers (for the VM and C modules at least). But no, you need to find 64-bit versions of the C modules.


The normal gains one get by using 64bit code in general. I haven't found any recent benchmarks, but at the time of x64 introduction, code could run up to 30% faster on 64bit than on 32bit on x86 hardware -- this gap certainly has fallen somehow with the optimizatgions since the time, but is still probably faster.

Also, you benefit of being ablle to transparantly use more than 4GB of memory should you need too.

Note however that the speed gains in 64bit are due to the awfull 32bit legacy ABI: enve a core i7 running in 32 bit has the same 4 general purpose registers (and a couple others) one had in the 80386 chip from 1987. And those mapped 1:1 to the register on the 8086 from the 70's. The 64 bit abi introduces more (real) general purpose registers, and that makes it for the speed gain. Otherwise, 64 bit code simply spends double the cache memory, which makes it, in other architectures, like PPC, be actually slower than 32bit code.