On Feb 27, 2005, at 7:26 PM, Gustavo J. A. M. Carneiro wrote:
2. the "memory" option: when a library is loaded, we create a special module object, derived from PyModule_Type, which contains an attribute getter (tp_getattro slot) that looks up, in runtime, types. Hence the need for the hash table here. So types aren't registered at module import, they are created on demand, as they're requested from themodule. A similar approach could be taken for loading methods on demandfor each object.
I'm thinking of a hybrid option for gtk2-perl --- at load time, find all the object types and register them as perl packages, but stop there. Then, use perl's AUTOLOAD magic to support demand-binding and caching of methods as they are called by the application. Still a load-time hit, but there are far more methods in the API than types. We'd have a hook in this process to create the hash table for ourselves if it didn't already exist.
--"Ears! They help us -- Ears! They help us hear th-- Ea--E--E--E--Ears!"
-- A Sesame Street singing toy, with Yvonne gleefully pressing
the button over and over and over and over and...