[Python-3000] Adaptation vs. Generic Functions
Guido van Rossum
guido at python.org
Sat Apr 8 17:01:41 CEST 2006
On 4/8/06, Phillip J. Eby <pje at telecommunity.com> wrote:
> >Even with the cache I put in? The hairy algorithm doesn't get invoked
> >more than once per actual signature (type tuple).
>
> You've measured it now, but yes, my own measurements of similar techniques
> in RuleDispatch showed the same effect, and as with your measurement, it is
> the Python code to build the tuple, rather than the tuple allocation
> itself, that produces the delays. The current version of RuleDispatch goes
> to some lengths to avoid creating any temporary data structures (if
> possible) for this reason.
Check out the accelerated version in time_overloading.py in the svn
sandbox/overloading/. It's mostly faster than the manual version!
Anyway, you seem to be confirming that it's the speed with which we
can do a cache lookup. I'm not worried about that now.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list