[Python-Dev] Opcode frequency

Carl Friedrich Bolz cfbolz at gmx.de
Wed Jun 18 23:20:50 CEST 2008


Georg Brandl wrote:
> Antoine Pitrou schrieb:
>>> Maciej Fijalkowski did an opcode analysis for PyPy,
>>> it also shows the relative frequency of opcodes following a
>>> specifc one:
>>>
>>> http://codespeak.net/svn/user/fijal/opcodes.txt
>>
>> Nice, but we have to be careful here: what is the tested workload?
>> For example, I find it hard to believe that CALL_FUNCTION_VAR_KW would
>> always (99%) be followed by STORE_FAST.
> 
> I'm sorry, I should have given a reference to the original message:
> http://codespeak.net/pipermail/pypy-dev/2008q2/004666.html
> 
>> I'm not even sure we're talking about the same VM/compiler. What are
>> CALL_LIKELY_BUILTIN and LOOKUP_METHOD? :-)
> 
> He used the PyPy compiler, of course.

Just for the reference, PyPy uses exactly CPython's opcodes. Then there
are some completely optional optimizations which add opcodes (like
CALL_LIKELY_BUILTIN and LOOKUP_METHOD) that can be enabled at compile time.

Cheers,

Carl Friedrich Bolz



More information about the Python-Dev mailing list