[pypy-issue] [issue1436] missed optimization on set contains

Amaury Forgeot d Arc tracker at bugs.pypy.org
Sat Apr 6 10:58:27 CEST 2013


Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

The difference disappears with --jit off.

In rdict.py, ll_dict_lookup() is unrolled only when jit.isconstant(key).
I haven't looked at the traces, but it's possible that in this case, the operation is a direct 
access to a known index...

This is not done when the key is in a variable, because of course it may change in the timeit 
loop.

Maybe the jit could learn about fastlocals that are unlikely to change, because there is no 
assignment in the loop?

----------
nosy: +amaury

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1436>
________________________________________


More information about the pypy-issue mailing list