Steve Holden wrote:

> Tim Delaney wrote:
>> BTW, one of my test cases involves multiple super calls in the same
>> method - there is a *very* large performance improvement by
>> instantiating it once. 
>> 
> And how does speed deteriorate for methods with no uses of super at
> all (which will, I suspect, be in the majority)?

Zero - in those cases, no super instance is instantiated. There is a
small one-time cost when the class is constructed in the reference
implementation (due to the need to parse the bytecode to determine if if
'super' is used) but in the final implementation that information will
be gathered during compilation.

Tim Delaney
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to