Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 209
endolith Avatar asked Dec 31 '10 03:12

endolith


People also ask

Can I use x86 on 64bit?

Yes, of course. Most programs are still 32 bit and run fine on 64-bit Windows systems. Those programs are machine language, which has a one-to-one mapping with assembly (and can be easily disassembled into x86 assembly code).

Should I use 64-bit or 32 bit python?

32-bit Python, and 32-bit apps generally, can access only 4GB of memory at a time. 64-bit applications don't have this limit, hence many data analysis and machine learning tools for Python work best in 64-bit incarnations. Some are available only in 64-bit versions.

Does Intel use x86-64?

Intel licenses x86-64 technology for use in their processors, much as AMD gets their x-86 from Intel.

Does 64-bit improve performance?

A processor lets us know how much memory access it can have from the CPU register. For example, A system with a 32-bit processor can access around 4GB of RAM or physical memory, whereas a 64-bit system can easily handle the memory of more than 4 GB, thus increasing the processor's performance capability.


1 Answers

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

like image 137
Martin v. Löwis Avatar answered Oct 14 '22 07:10

Martin v. Löwis