[Python-Dev] Who cares about the performance of these opcodes?

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Mar 9 17:26:44 EST 2004


"Phillip J. Eby" <pje at telecommunity.com>:

> If the goal is to remove lines from the switch statement, just move the 
> code of lesser-used opcodes into a C function.  There's no need to 
> eliminate the opcodes themselves.

Naively, one might think that, if the code is rarely used, even if
it's inside the switch, it'll rarely be in the cache and thus wouldn't
make much difference.

But I suspect the cacheing issues are more subtle than just the total
amount of code in the switch statement, and the only way to be sure
is to measure.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list