[Python-Dev] opcode performance measurements

Tim Peters tim.one@home.com
Thu, 31 Jan 2002 17:30:22 -0500


[Aahz]
> My suggestion WRT SET_LINENO is to encourage the use of python -O and
> PYTHONOPTIMIZE.

What SET_LINENO does isn't even used in normal Python operation anymore
(line numbers in tracebacks are obtained via a different means, the
co_lnotab member of PyCodeObjects).  They're needed now only to call back to
user-supplied tracing routines, and that's rarely needed.  The Python
debugger is the most visible example of a tool that uses the line tracing
hook.  There are others way to get that to work, but they require real
thought and effort to implement.  There's a patch on SourceForge (IIRC, from
Vladimir) that may have worked at one time, but nobody has picked it up (I
tried to for 2.2, but couldn't make time for it then; I don't expect to have
time for it for 2.3 either, alas).