Performance of instrumented FOR_ITER
is poor as DISABLE
doesn't remove the instrumentation.
#128375
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-feature
A feature request or enhancement
Disabling the "not taken" branch of an instrumented
FOR_ITER
does not de-instrument theFOR_ITER
, it only de-instruments theNOT_TAKEN
which prevents specialization and JIT compilation of theFOR_ITER
. It is only when the loop exits, that theFOR_ITER
is de-instrumented.Instead of instrumenting the
FOR_ITER
we could instrument thePOP_TOP
at the end of the loop.This will add an extra instruction dispatch when exiting the loop, as
FOR_ITER
and its specializations will need to jump to thePOP_TOP
instead of over it. We already do this in tier2, so the overhead should be negligible, and it might simplify the code a bit.Linked PRs
FOR_ITER
#128445The text was updated successfully, but these errors were encountered: