<br><br><div class="gmail_quote">On Fri, Nov 27, 2009 at 1:49 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2009/11/27 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div class="im">&gt; Hi Nicholas,<br>
&gt;     here are my timings from Cog.  Only the ratios correspond since the<br>
&gt; source file is of a different size, my machine is different, and Cog runs at<br>
&gt; very different speeds to the interpreter.  With that in mind...<br>
&gt; t1 is nextLine over the sources file via StandardFileStream<br>
&gt; t2 is nextLine over the sources file via BufferedFileStream<br>
&gt; t3 is next over the sources file via StandardFileStream<br>
&gt; t4 is next over the sources file via BufferedFileStream<br>
&gt; Cog: an OrderedCollection(11101 836 9626 2306)<br>
&gt; Normalizing to the first measurement: 1.0 0.075 0.867 0.208<br>
&gt; Your ratios are 1.0 0.206 4.827 0.678<br>
&gt;<br>
&gt; I&#39;d say BufferedFileStream is waaaaay faster :)<br>
&gt;<br>
<br>
</div>Impressive.<br>
I presume every Smalltalk message is accelerated while primitive call<br>
remain expensive...<br></blockquote><div><br></div><div>Exactly.  Or rather, the primitives which aren&#39;t implemented in machine code are even slower to invoke from machine code than in the interpreter.  Machine code primitives exist for SmallInteger + - / * // \\ % &gt; &gt;= &lt; &lt;= = ~=, for Float + - * / &gt; &gt;= &lt; &lt;= = ~=, for Object == at: ByteString at: and for BlockClosure value[:value:value:value:].  Once I reimplement the object representation I&#39;ll be happy to implement Object&gt;&gt;at:put: ByteString&gt;&gt;at:put: Behavior&gt;&gt;basicNew &amp; Behavior&gt;&gt;basicNew: which should result in another significant step in performance.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt;<br>
&gt; P.S. your timing doit revealed a bug in Cog which is why it has taken a<br>
&gt; while to respond with the results :)  The doit&#39;s temp names are encoded and<br>
&gt; appended to the method as extra bytes.  The JIT wasn&#39;t ignoring these extra<br>
&gt; bytes, and your doit just happened to cause the JIT to follow a null pointer<br>
&gt; mistakenly scanning these extra bytes.  So thank you :)<br>
&gt;<br>
<br>
</div>Oh, you discovered my secret for finding bugs: (bad) luck<br></blockquote><div><br></div><div>:) :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<font color="#888888"><br>
Nicolas<br>
</font><div><div></div><div class="h5"><br>
&gt; On Wed, Nov 18, 2009 at 3:10 AM, Nicolas Cellier<br>
&gt; &lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I just gave a try to the BufferedFileStream.<br>
&gt;&gt; As usual, code is MIT.<br>
&gt;&gt; Implementation is rough, readOnly, partial (no support for basicNext<br>
&gt;&gt; crap &amp; al), untested (certainly has bugs).<br>
&gt;&gt; Early timing experiments have shown a 5x to 7x speed up on [stream<br>
&gt;&gt; nextLine] and [stream next] micro benchmarks<br>
&gt;&gt; See class comment of attachment<br>
&gt;&gt;<br>
&gt;&gt; Reminder: This bench is versus StandardFileStream.<br>
&gt;&gt; StandardFileStream is the &quot;fast&quot; version, CrLf anf MultiByte are far<br>
&gt;&gt; worse!<br>
&gt;&gt; This still let some more room...<br>
&gt;&gt;<br>
&gt;&gt; Integrating and testing a read/write version is a lot harder than this<br>
&gt;&gt; experiment, but we should really do it.<br>
&gt;&gt;<br>
&gt;&gt; Nicolas<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>