[Python-Dev] default of returning None hurts performance? (original) (raw)
Raymond Hettinger python at rcn.com
Tue Sep 1 00:39:47 CEST 2009
- Previous message: [Python-Dev] default of returning None hurts performance?
- Next message: [Python-Dev] default of returning None hurts performance?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I was just wondering if a bytecode for a superinstruction of the common sequence:
6 POPTOP 7 LOADCONST 0 (None) 10 RETURNVALUE might be worth it.
[Collin Winter]
I doubt it. You'd save a bit of stack manipulation, but since this will only appear at the end of a function, I'd be skeptical that this would make any macrobenchmarks (statistically) significantly faster.
I concur with Collin. And since it appears only at the end of a function, the optimization doesn't help inner-loops in a function (where most of the time usually spent).
Raymond
- Previous message: [Python-Dev] default of returning None hurts performance?
- Next message: [Python-Dev] default of returning None hurts performance?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]