[pypy-dev] Spurious dict lookups in my JIT loops
Armin Rigo
arigo at tunes.org
Sun Sep 18 09:56:26 CEST 2011
Hi Boris,
All machine code instructions produced by the JIT have a place that
they code from in your RPython code. In this case I suspect that it's
from self.compare(), but again, it's a bit hard to know without having
access to the complete source code.
Alternatively, there is a way to display where the operations come
from, but only during testing. You might rewrite your example as a
test --- as opposed to, I suppose, a targetxxx.py. See the infinite
amount of tiny examples in pypy/jit/metainterp/test/test_*.py, e.g.
test_ajit.py. Write a new file in the same directory. The point is
then that you can run the test with "python test_all.py
test_yourfile.py --viewloops". It reports the same traces, but
organized as a call graph and with the origin shown before every
operation.
A bientôt,
Armin.
More information about the pypy-dev
mailing list