Another benchmark where Pypy is much slower than CPython
Hi, while working on some MDP code, I discovered that it was several times as slow under Pypy as CPython. Attached is a benchmark demonstrating this. On my computer, the benchmark takes 70.3 seconds under CPython 2.7.3 64bit, but it takes 273.6 seconds under pypy-c-jit-71056-c8e3b8cbc843-win32, the latest version I could find. The code is not at all optimized, but I still found it strange that Pypy did so much worse. The code doesn't seem that complex, but perhaps the usage of nameduples is triggering pathological behavior from the JIT's point of view.
I've reproduced the performance on the latest default (on OS X, FWIW). I'm starting to profile now. Alex PS: Your namedtuple usage is fine. On Mon, Apr 28, 2014 at 8:43 PM, Robert Grosse <n210241048576@gmail.com>wrote:
Hi, while working on some MDP code, I discovered that it was several times as slow under Pypy as CPython. Attached is a benchmark demonstrating this.
On my computer, the benchmark takes 70.3 seconds under CPython 2.7.3 64bit, but it takes 273.6 seconds under pypy-c-jit-71056-c8e3b8cbc843-win32, the latest version I could find.
The code is not at all optimized, but I still found it strange that Pypy did so much worse. The code doesn't seem that complex, but perhaps the usage of nameduples is triggering pathological behavior from the JIT's point of view.
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
-- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero GPG Key fingerprint: 125F 5C67 DFE9 4084
Initial results of profiling (cProfile): most of the time is in generators, and in evaluate(). 6 aborts, all trace too long. Both tracing and backend times are a tiny percentage of the overall time. In other words, none of the usual suspects. I probably won't get any more done before going to bed tonight. Alex On Mon, Apr 28, 2014 at 9:59 PM, Alex Gaynor <alex.gaynor@gmail.com> wrote:
I've reproduced the performance on the latest default (on OS X, FWIW). I'm starting to profile now.
Alex
PS: Your namedtuple usage is fine.
On Mon, Apr 28, 2014 at 8:43 PM, Robert Grosse <n210241048576@gmail.com>wrote:
Hi, while working on some MDP code, I discovered that it was several times as slow under Pypy as CPython. Attached is a benchmark demonstrating this.
On my computer, the benchmark takes 70.3 seconds under CPython 2.7.3 64bit, but it takes 273.6 seconds under pypy-c-jit-71056-c8e3b8cbc843-win32, the latest version I could find.
The code is not at all optimized, but I still found it strange that Pypy did so much worse. The code doesn't seem that complex, but perhaps the usage of nameduples is triggering pathological behavior from the JIT's point of view.
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
-- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero GPG Key fingerprint: 125F 5C67 DFE9 4084
-- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero GPG Key fingerprint: 125F 5C67 DFE9 4084
participants (2)
-
Alex Gaynor
-
Robert Grosse