Speed: bytecode vz C API calls
Jacek Generowicz
jacek.generowicz at cern.ch
Fri Dec 12 04:04:28 EST 2003
Peter Otten <__peter__ at web.de> writes:
> See below for my ideas towards a generalized memoizing framework.
[I haven't the time to have a look at it in any detail right now, so
forgive me for not responding/commenting in full, just yet.]
> > def foo(some_type):
> > ...
> > return something
> >
> >
> > foo = memoize(foo)
> >
> > data = [int, float, my_class, his_class, str, other_class] * 10**6
> >
> > map(foo, data) [+]
>
> Do you discard the result for real?
No, sorry, of course not.
> > [+] Can you see why I don't want to mess with the call site ?
>
> No.
It would mean taking it out of the map and that would mean losing the
C-coded loop that map provides.
> Now to my code. The idea is to make memoized functions available to
> different modules from a central registry, and to expose the cached results
> for hand-optimized hotspots. Otherwise it was all mentioned in this thread,
> if not the original post.
I'll make sure to find the time to study this.
More information about the Python-list
mailing list