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

endolith picture endolith · Dec 31, 2010 · Viewed 18.3k times · Source

What kind of benefits are there to running the amd64 builds of Python and extensions? (Lots of extensions compiled for amd64 here.) I have an i5 processor and Win7 64-bit, so it seems like it would be appropriate. But it also sounds like it is buggy, beta, unsupported, etc.

Does it actually provide a performance benefit? In which areas? I'd be running SciPy, NumPy, etc. I occasionally get "out of memory" errors with 32-bit Python and my machine has 4 GiB of RAM.

Can win32 packages be installed on a 64-bit Python base if no 64-bit version of the package exists?

Answer

Martin v. Löwis picture Martin v. Löwis · Dec 31, 2010

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).