<p dir="ltr">How to include aioplugin in pharovm?</p>
<p dir="ltr">See messages below for the reason why.</p>
<p dir="ltr">Phil</p>
<div class="gmail_quote">---------- Message transféré ----------<br>De : &quot;David T. Lewis&quot; &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;<br>Date : 16 oct. 2014 01:30<br>Objet : Re: [Pharo-dev] OSProcess in 3.0<br>À : &quot;Pharo Development List&quot; &lt;<a href="mailto:pharo-dev@lists.pharo.org">pharo-dev@lists.pharo.org</a>&gt;<br>Cc : <br><br type="attribution">On Tue, Oct 14, 2014 at 09:35:44PM +0200, Thierry Goubier wrote:<br>
&gt;<br>
&gt;<br>
&gt; Le 14/10/2014 14:15, David T. Lewis a ?crit :<br>
&gt; &gt;On Tue, Oct 14, 2014 at 07:19:10AM +0200, Thierry Goubier wrote:<br>
&gt; &gt;&gt;Hi Dave,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;took me a while to do some testing. It seems there is an issue, but I<br>
&gt; &gt;&gt;couldn&#39;t find out where. First, the data:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;Loading a package from a local gitfiletree repository (get from the<br>
&gt; &gt;&gt;command a zipped git archive containing the package) :<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;4.5.11, 4.6.8: 2132 msec.<br>
&gt; &gt;&gt;4.5.12, 4.6.9: 50847 msec.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;I tried to rewrite the main command, remove the closePipes, etc... No<br>
&gt; &gt;&gt;change in the runtime, so your right.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;Profiling doesn&#39;t help much: execution time is mostly idle time (but<br>
&gt; &gt;&gt;with a significant increase on PipeableOSProcess commands: goes from<br>
&gt; &gt;&gt;invisible to 2700 ms. A user break in the middle shows it delay waiting<br>
&gt; &gt;&gt;on output of the external process).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;Only hint I could see is that it seems to be linked with the size of the<br>
&gt; &gt;&gt;output of the command.<br>
&gt; &gt;<br>
&gt; &gt;Thierry,<br>
&gt; &gt;<br>
&gt; &gt;Aha! I am quite sure that you have located the problem. There must be<br>
&gt; &gt;something preventing the OS process from running to completion with<br>
&gt; &gt;a larger amount of output data. It definitely sounds like a bug in my<br>
&gt; &gt;latest update to Pipeable OSProcess.<br>
&gt;<br>
&gt; The strange thing is that it runs to completion (i.e. I got no errors;<br>
&gt; if any data was missing or corrupted on output, my load would fail); but<br>
&gt; a lot slower than it should be.<br>
&gt;<br>
&gt; &gt;Thank you very much for finding this. I will get it fixed as quickly<br>
&gt; &gt;as I can.<br>
&gt;<br>
&gt; Thanks. I&#39;m unable to help you much, I&#39;m afraid :(<br>
<br>
Thierry,<br>
<br>
I do not yet have a solution to this, but I have been able to confirm<br>
that the performance difference that you see is primarily associated with<br>
the AioPlugin not being present in your VM.<br>
<br>
When I changed PipeableOSProcess to handle pipe handle closing properly,<br>
I used a buffered output stream that is driven by aio events. When data<br>
is available to be read from the external OS process, an aio notification<br>
pulls the available data into the buffered stream, and when no more data<br>
is available, the pipe (file) handles are closed.<br>
<br>
If the plugin is not present in the VM, I provided a polling mechanism<br>
to read data from the external OS process. Apparently this is very<br>
inefficient, and I am sure it could be greatly improved. That is the<br>
cause of the extremely slow performance that you are seeing.<br>
<br>
So in summary: The enhancement to PipeableOSProcess relies on an aio<br>
event driven reader, and if the AIO plugin is missing, the fallback code<br>
relies on polling, and is horribly inefficient.<br>
<br>
More to follow, and thank you again for identifying the problem.<br>
<br>
If you can convice your VM vendor to include AioPlugin in your VM, that<br>
would be helpful also ;-)<br>
<br>
Dave<br>
<br>
<br>
</div>