Significant performance degradation with 2.6.1
Created originally on Bitbucket by prabhuramachandran (Prabhu Ramachandran)
I have been noticing a large degradation of performance with 2.6.1 (when compared to 2.5.1) in a demo numerical code that I use for a class I teach. The code uses numpy and pypy. I have narrowed it down to a small example that I have attached. It requires numpy which I obtained from here: bitbucket.org/pypy/numpy and I just updated to the latest (bitbucket.org/pypy/numpy/commits/eb3a35530360956ce5b23fdddb4726a87298c0c4) on both 2.6.1 and 2.5.1 (64 bit).
Please run the attached file using pypy 2.5.1 and 2.6.1. Here are my numbers:
$ pypy-2.5.1-osx64/bin/pypy bench.py
Slow:
20 loops; n = 1000
avg, min, max: 0.0173585057259 0.0148329734802 0.0546190738678
Trying with the fast variant:
20 loops; n = 1000
avg, min, max: 0.0177025556564 0.0155758857727 0.0379099845886
$ pypy-2.6.1-osx64/bin/pypy bench.py
Slow:
20 loops; n = 1000
avg, min, max: 0.307449471951 [ 0.29886508] [ 0.37315512]
Trying with the fast variant:
20 loops; n = 1000
avg, min, max: 0.0272699356079 [ 0.02398992] [ 0.0569458]
There is a 20x reduction in my numbers on my Mac OS X machine with 2.6.1 when compared to 2.5.1. I have reproduced the issue on Linux also. I am using the same numpy version on both 2.5.1 and 2.6.1 so this doesn't look like a numpy issue per-se but more like an issue with mixed complex/floats and numpy data types that is specific to 2.6.1.
There is also a weird issue with the 2.6.1 in that if I do not run the "slow" variant, the performance of the faster version is better!
Please let me know if there are any questions you have. Thanks!
Attachments: bench.py