pypy on windows much slower than linux/mac when using complex number type?
Irmen de Jong
irmen.NOSPAM at xs4all.nl
Tue Sep 20 16:38:02 EDT 2016
Hi,
I've stumbled across a peculiar performance issue with Pypy across some different
platforms. It was very visible in some calculation heavy code that I wrote that uses
Python's complex number type to calculate the well-known Mandelbrot set.
Pypy running the code on my Windows machine is doing okay, but when running the same
code on Pypy on different systems, the performance difference is so big it is not even
funny. The other implementations are MUCH faster than the windows one. Which is quite
unexpected because the other machines I've tested on have the same or much lower
physical CPU specs than the windows machine. Here's the comparison:
Machine specs:
Windows: 64 bits Windows 7, Intel Core 2 Quad 3.4 Ghz
Linux: 32 bits Mint 18, Virtualbox VM on above windows machine
Mac mini: OS X 10.11.6, Intel Core 2 Duo 2.53 Ghz
The test code I've been using is here:
https://gist.github.com/irmen/c6b12b4cf88a6a4fcf5ff721c7089078
Test results:
function: mandel / iterations
Mac mini, Pypy 5.4.1 (64-bit): 0.81 sec / 0.65 sec
Linux, Pypy 5.1 (32-bit): 1.06 sec / 0.64 sec
Windows, Pypy 5.4.1 (32-bit): 5.59 sec / 2.87 sec
What could cause such a huge difference?
Is it perhaps a compiler issue (where gcc/clang are MUCH better at optimizing certain
things, although I wonder how much of a factor this is because Pypy is doing JITting by
itself as far as I am aware)? Or is something strange going on with the way the
complex number type is implemented? (the difference doesn't occur when using only floats)
Regards
Irmen de Jong
More information about the Python-list
mailing list