<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 : "David T. Lewis" <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>><br>Date : 16 oct. 2014 01:30<br>Objet : Re: [Pharo-dev] OSProcess in 3.0<br>À : "Pharo Development List" <<a href="mailto:pharo-dev@lists.pharo.org">pharo-dev@lists.pharo.org</a>><br>Cc : <br><br type="attribution">On Tue, Oct 14, 2014 at 09:35:44PM +0200, Thierry Goubier wrote:<br>
><br>
><br>
> Le 14/10/2014 14:15, David T. Lewis a ?crit :<br>
> >On Tue, Oct 14, 2014 at 07:19:10AM +0200, Thierry Goubier wrote:<br>
> >>Hi Dave,<br>
> >><br>
> >>took me a while to do some testing. It seems there is an issue, but I<br>
> >>couldn't find out where. First, the data:<br>
> >><br>
> >>Loading a package from a local gitfiletree repository (get from the<br>
> >>command a zipped git archive containing the package) :<br>
> >><br>
> >>4.5.11, 4.6.8: 2132 msec.<br>
> >>4.5.12, 4.6.9: 50847 msec.<br>
> >><br>
> >>I tried to rewrite the main command, remove the closePipes, etc... No<br>
> >>change in the runtime, so your right.<br>
> >><br>
> >>Profiling doesn't help much: execution time is mostly idle time (but<br>
> >>with a significant increase on PipeableOSProcess commands: goes from<br>
> >>invisible to 2700 ms. A user break in the middle shows it delay waiting<br>
> >>on output of the external process).<br>
> >><br>
> >>Only hint I could see is that it seems to be linked with the size of the<br>
> >>output of the command.<br>
> ><br>
> >Thierry,<br>
> ><br>
> >Aha! I am quite sure that you have located the problem. There must be<br>
> >something preventing the OS process from running to completion with<br>
> >a larger amount of output data. It definitely sounds like a bug in my<br>
> >latest update to Pipeable OSProcess.<br>
><br>
> The strange thing is that it runs to completion (i.e. I got no errors;<br>
> if any data was missing or corrupted on output, my load would fail); but<br>
> a lot slower than it should be.<br>
><br>
> >Thank you very much for finding this. I will get it fixed as quickly<br>
> >as I can.<br>
><br>
> Thanks. I'm unable to help you much, I'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>