|
From: Kevin D. <kda...@we...> - 2001-08-07 23:49:40
|
----- Original Message ----- From: "john coppola" <joh...@ya...> To: <pe...@in...>; <jyt...@li...> Sent: Tuesday, August 07, 2001 6:08 PM Subject: Re: [Jython-dev] Jython and native java merged with simplicity [snip] > What is important about the nature of ghosting is that > information is stored in both the java native skeleton > and the real PyObject. The same information in two > places. Somewhat of an OO no no. But I am willing to > make this trade off to get 500x performance boost. > Since all it requires is a bit a maintenance work in > well tucked away places. > > > This seems funny, and alot of work, but really isn't. > Once you see the speed boost obtained from doing bulk > processing you may deem this feature worthwhile. Hmm... It seems like what you're talking about can be already accomplished with ExtensionClass (today) and possibly 2.2's class/type fix (tomorrow). I haven't read much about the 2.2 functionality. phabric's Acquisition module uses the ExtensionClass mechanism. For convenience, Acquisition is implemented as a Python module: http://cvs.phabric.org/index.cgi/phabric/py/Acquisition.py?rev=1.5&content-t ype=text/x-cvsweb-markup But, if you look at the ImplicitAcquisitionWrapper, the heavy lifting is done completely in Java and with Java variables. When you have an instance of an ImplicitAcquisitionWrapper, what you have is not an org.python.core.PyInstance, but an org.phabric.ec.AqWrapper: http://cvs.phabric.org/index.cgi/phabric/src/org/phabric/ec/AqWrapper.java?r ev=1.3&content-type=text/x-cvsweb-markup Currently, the ExtensionClass package will use reflection to automatically find public methods, and it adds those methods to the class __dict__. It would be possible to add support to ExtensionClass to do something similar for attributes. So, if you call foo.aq_acquire it looks in foo's __dict__, finds aq_acquire and calls it. The search through the containment hierarchy happens completely in Java, using Java's aq_self and aq_parent variables. Rather than changing PyInstance itself, ExtensionClass just instantiates a class that extends PyInstance. Kevin p.s. What I said above still stands, but I just realized that I haven't yet committed the more complete form of aq_acquire that I've recently finished... |