[omniORB] omniorbpy: switching GC off for duration of every outgoing call
Michael Kilburn
crusader.mike at gmail.com
Sat Jan 17 01:37:36 GMT 2015
On Fri, Jan 16, 2015 at 9:07 AM, Duncan Grisby <duncan at grisby.org> wrote:
> On Mon, 2015-01-12 at 23:48 -0600, Michael Kilburn wrote:
> > Is there any easy way in omniOrbPy to automatically switch gc off in
> > every outgoing call? (and then switch it back once all data is
> > received and converted to python objects)
>
> You could register clientSendRequest and clientReceiveReply interceptors
> to disable and then re-enable the GC. Beware that if your code is
> multi-threaded, the GC is a global option, so your threads could tread
> on each other.
>
Nope... Tested it today -- it does not work the way I need.
clientReceiveReply gets called before incoming data gets converted into
Python types and I suspect clientSendRequest is similar.
Basically I am looking for an easy way to get effect (equivalent to
following pseudo-code) applied to every CORBA call in my python app:
before:
data = myObj->corba_method();
after:
gc.disable()
data = myObj->corba_method();
gc.enable();
(well, obviously it needs to be more robust than that, take care of MT
issues -- but it is irrelevant on this stage).
Any ideas?
P.S. In case if you think I am nuts -- in my case this difference
translates into 10 vs 160 seconds of execution time (i.e. up to 16-fold
speedup). Yep, we move around large number of very tiny Python objects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20150116/392ca36e/attachment.html>
More information about the omniORB-list
mailing list