On 2/25/2008 4:46 PM, Phil Thompson wrote:

Thanks for your change, but this is a showstopper for me, so I guess I
will have to find a different solution. Specifically, I would also need
to remove the attribute and readd it later, etc.
(The GC issue also worries me, but I have not analyzed its implications
in details).

I'm mentioning because, if you are not comfortable with this change, you
might want to simply back it out as I'm not going to excercise it.

I've already made a note to myself in the comments to consider removing the cache. It avoids a GIL acquire/release and an attribute lookup each time C++ invokes a virtual.

(I've just noticed that the GIL is acquired and released in the common case where there is no Python reimplementation - now fixed.)

You can experiment with disabling the cache if you want (just remove the call that sets the flag when the cache has been filled). I'd remove the cache if was proved not to be of significant benefit.

OK I'll try. I'm not a CPython guru, but isn't there a C-level __setattr__ (that is, a callback when a certain attribute is changed) that you can override for SIP objects with C++ virtual functions? Given that the C++ virtual functions is a fixed compile-time list, it shouldn't be too slow to invalidate the cache only when required.
--
Giovanni Bajo

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to