predicting function calls?

Roy Smith roy at panix.com
Sat Dec 31 09:50:27 EST 2005


In article <41ng2lF1fg0bkU1 at individual.net>, Ernst Noch <enoch at gmx.net> 
wrote:

> Couldn't you just, for every access to a member of your object, first 
> try to treat is as an access to an operation? If this fails (you 
> mentioned the db will throw an error if this is an attribute instead of 
> an operation), fall back to ask the db for an attribute of that name.
> 
> Or maybe just ask the db to look up this attribute in the list of 
> operations, depending which is faster.
> 
> Btw. if the system is very dynamic, you might have to think about also 
> implementing the attributes as proxies.

Well, what I ended up doing is having a proxy for each object.  The first 
time I access any instance of a given class, I get from the DB a list of 
operations for that class and cache it (keyed by class).



More information about the Python-list mailing list