<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jan 16, 2015 at 9:07 AM, Duncan Grisby <span dir="ltr">&lt;<a href="mailto:duncan@grisby.org" target="_blank">duncan@grisby.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Mon, 2015-01-12 at 23:48 -0600, Michael Kilburn wrote:<br></span><span class="">&gt; Is there any easy way in omniOrbPy to automatically switch gc off in<br>
&gt; every outgoing call? (and then switch it back once all data is<br>
&gt; received and converted to python objects)<br>
<br>
</span>You could register clientSendRequest and clientReceiveReply interceptors<br>
to disable and then re-enable the GC. Beware that if your code is<br>
multi-threaded, the GC is a global option, so your threads could tread<br>
on each other.<br></blockquote><div> </div><div>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.</div><div><br></div><div>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:</div><div><br></div><div>before:</div><div>      data = myObj-&gt;corba_method();</div><div><br></div><div>after:</div><div>     gc.disable()</div><div>     data = myObj-&gt;corba_method();</div><div>     gc.enable();</div><div><br></div><div>(well, obviously it needs to be more robust than that, take care of MT issues -- but it is irrelevant on this stage).</div><div><br></div><div>Any ideas?</div><div><br></div><div>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.</div><div><br></div></div>
</div></div>