Amaury Forgeot d Arc <[email protected]> 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 <[email protected]>
<https://bugs.pypy.org/issue1436>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to