<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 17, 2016 at 1:17 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</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">Hi Bernhard,<br>
<br>
InterpreterPlugin is part of the VMMaker package, so you would need to be<br>
working in an image with VMMaker loaded (maybe one of the prepared image<br>
from Eliot&#39;s site).<br></blockquote><div><br></div><div>There aren&#39;t any.  There is a script in the image subdirectory of <a href="http://www.github.com/opensmalltalk/vm">http://www.github.com/opensmalltalk/vm</a> which builds one; see image/buildspurtrunkvmmakerimage.sh</div><div><br></div><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">I should have checked my own notes before replying - I cannot explain the<br>
reason for this, but it seems that the readdir() primitives no longer<br>
provided any performance benefit when I tested them a couple of years ago.<br>
<br>
Here is what I wrote in the summary on<br>
<a href="http://www.squeaksource.com/DirectoryPlugin" rel="noreferrer" target="_blank">http://www.squeaksource.com/<wbr>DirectoryPlugin</a>:<br>
<br>
Performance characteristics have changed significantly since Squeak circa<br>
2003. The readdir() primitives no longer provide any benefit, but the file<br>
testing primitives still yield a couple orders of magnitude improvement<br>
for some functions.<br>
<br>
<br>
So ... I guess that some additional profiling would be in order.<br>
<br>
Dave<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
&gt; Hi Dave,<br>
&gt;<br>
&gt; Thanks for the answer. I guess I would need to build the latest version of<br>
&gt; the plugin myself, right? (I am on macOS Sierra.)<br>
&gt;<br>
&gt; I could load DirectoryPlugin. However,<br>
&gt; VMConstruction-Plugins-<wbr>DirectoryPlugin needs InterpreterPlugin available.<br>
&gt;<br>
&gt; Bernhard<br>
&gt;<br>
&gt;&gt; Am 17.10.2016 um 19:56 schrieb David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;:<br>
&gt;&gt;<br>
&gt;&gt; It is probably far too bit-rotted to be of any use now, but here is what<br>
&gt;&gt; I<br>
&gt;&gt; came up with 15 years ago to improve this:<br>
&gt;&gt;<br>
&gt;&gt;  <a href="http://wiki.squeak.org/squeak/2274" rel="noreferrer" target="_blank">http://wiki.squeak.org/squeak/<wbr>2274</a><br>
&gt;&gt;<br>
&gt;&gt; I did briefly look at this again a couple of years ago, and put the<br>
&gt;&gt; updates on SqueakSource. But I think I found that the directory<br>
&gt;&gt; primitives<br>
&gt;&gt; are nowhere near as big a win now as they were 15 years ago.<br>
&gt;&gt; Nevertheless<br>
&gt;&gt; it may still be of some interest.<br>
&gt;&gt;<br>
&gt;&gt; Dave<br>
&gt;&gt;<br>
&gt;&gt;&gt; Dear Squeakers,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I want to count files with a certain extension in a folder recursively.<br>
&gt;&gt;&gt; Here is the code I use:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; | dir count runtime |<br>
&gt;&gt;&gt; count := 0.<br>
&gt;&gt;&gt; dir := FileDirectory on:<br>
&gt;&gt;&gt; &#39;/Users/bernhard/Library/Mail/<wbr>V4/D77E3582-7EBE-4B5A-BFE0-<wbr>E30BF6AE995F/Smalltalk.mbox/<wbr>Squeak.mbox&#39;.<br>
&gt;&gt;&gt; runtime := Time millisecondsToRun: [<br>
&gt;&gt;&gt;     dir directoryTreeDo: [:each |<br>
&gt;&gt;&gt;             (each last name endsWith: &#39;.emlx&#39;) ifTrue: [count := count + 1]]].<br>
&gt;&gt;&gt; {count. runtime}. #(289747 66109)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; As you can see it finds 289.747 files and it takes about 66 seconds. Is<br>
&gt;&gt;&gt; there any faster way to do this given the current VM primitives?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The reason I ask is that the equivalent Python code takes between 1.5<br>
&gt;&gt;&gt; and<br>
&gt;&gt;&gt; 6 seconds. :-/<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; #!/usr/local/bin/python3<br>
&gt;&gt;&gt; import os<br>
&gt;&gt;&gt; import time<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; path =<br>
&gt;&gt;&gt; &#39;/Users/bernhard/Library/Mail/<wbr>V4/D77E3582-7EBE-4B5A-BFE0-<wbr>E30BF6AE995F/Smalltalk.mbox/<wbr>Squeak.mbox&#39;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; print(path)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; start = time.time()<br>
&gt;&gt;&gt; emlx = 0<br>
&gt;&gt;&gt; for dirpath, dirnames, filenames in os.walk(path):<br>
&gt;&gt;&gt;    for filename in filenames:<br>
&gt;&gt;&gt;        if filename.endswith(&#39;.emlx&#39;):<br>
&gt;&gt;&gt;            emlx += 1<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; runtime = time.time() - start<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; print(emlx, runtime)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It seems to have to do with an optimized os.scandir() function,<br>
&gt;&gt;&gt; described<br>
&gt;&gt;&gt; here: <a href="https://www.python.org/dev/peps/pep-0471/" rel="noreferrer" target="_blank">https://www.python.org/dev/<wbr>peps/pep-0471/</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt; Bernhard<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>