[pypy-issue] [issue843] PyPy slower than CPython with puzzle problem

Justin Peel tracker at bugs.pypy.org
Sat Sep 10 01:50:35 CEST 2011

Justin Peel <peelpy at gmail.com> added the comment:

Most of the time is spent in list's index function in your non-set 
implementation. This is the case for both CPython and Pypy.
Multimethods make up a lot of the Pypy index's function's time for this code. 
Also, there is an unnecessary length check in equal_wrappeditems. In addition, 
this code should hopefully be sped up by the list-strategies branch when it is 

As a side note, you are doing each list.index twice with the same value.. which 
about halves the time for both CPython and Pypy when this is changed.

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list