Optimizing multiple dispatch

Brian Gough bjg at network-theory.co.uk
Thu Jun 3 09:01:07 EDT 2004


Jacek Generowicz <jacek.generowicz at cern.ch> writes:

> Profiling suggests that "tuple(map(type, args))" is taking a
> significant proportion of time in certain critical loops.
> Do you have any suggestions about how to make in run faster? (Either
> by optimizing "tuple(map(type, args)", or by using a completely
> different organization for the whole thing.

If the arguments inside the loop have fixed types, then maybe you
could have a method to get the reference to the function (once)
outside the loop.

This would be like methodForSelector in Objective-C.

-- 
Brian Gough

Network Theory Ltd,
Publishing the Python Manuals --- http://www.network-theory.co.uk/



More information about the Python-list mailing list