<br><br><div class="gmail_quote">On Tue, Dec 21, 2010 at 8:27 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
The only issue with BMPReadWriterPlugin was that for some reason the primitives weren&#39;t used. Probably an oversight on my behalf when I did the last Teleplace/Squeak sync. Fixed now.<br>
<br>
Benchmarks: 1600x1200 24bpp image<br>
<br>
[Form fromFileNamed: &#39;benchmark.bmp&#39;] timeToRun.<br>
<br>
Interpreter read:  1684 msecs<br>
Cog read:          1158 msecs<br>
Primitive read:     100 msecs<br>
<br>
<br>
[BMPReadWriter putForm: f onFileNamed: &#39;benchmark.bmp&#39;] timeToRun.<br>
<br>
Interpreter write:  693 msecs<br>
Cog write:          434 msecs<br>
Primitive write:     32 msecs<br>
<br>
So much for &quot;just a bit&quot; in speed. It&#39;s even more than I remembered[*].<br>
<br>
[*] In particular considering that [Form extent: 1600@1200 depth: 32] timeToRun =&gt; 80 msecs. In other words the &quot;real&quot; performance difference is rather more along the lines of 50x in the actual code.<br></blockquote>
<div><br></div><div>Interesting.  I just profiled this (*) with the VM interpreter and the culprit is the file i/o implementation. On Mac OS X fully 70% of entire execution time is in the lseek and write system calls.  That explains why the speedup with Cog is so modest.  Cog is unable to speedup the file writes. </div>
<div><br></div><div>(*) I&#39;m actually profiling the entirety of </div><div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span>(BMPReadWriter on: (FileStream fileNamed: &#39;benchmark.bmp&#39;) binary)</div>
<div><span class="Apple-tab-span" style="white-space: pre; ">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>nextPutImage: (Form extent: 1600@1200 depth: 32);</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>close</div>
</div><div><br></div><div>Mac OS X 10.6.5 2.66GHz Core i7 Cog</div><div><br></div><div><div>[(BMPReadWriter on: (FileStream fileNamed: &#39;benchmark.bmp&#39;) binary)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>nextPutImage: (Form extent: 1600@1200 depth: 32);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>close] timeToRun 8701  (e.g. I see numbers in the 8600 to 9500 range)</div></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Cheers,<br>
  - Andreas<br>
<br>
On 12/21/2010 7:41 PM, Andreas Raab wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 12/21/2010 2:33 PM, Igor Stasenko wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
i just stumbled over it, and i thought that today, we don&#39;t really<br>
need such kind of cruft.<br>
</blockquote>
<br>
This ain&#39;t cruft. This is a 10x performance boost (even over Cog).<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is just a two methods, and there is nothing essential, in it.<br>
</blockquote>
<br>
The plugin is absolutely essential for high-performance reading of<br>
standard 24bpp BMP files.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And i think that .bmp image format is really crappy format, which no<br>
one using today,<br>
</blockquote>
<br>
Very funny. Spoken like a true Macvocate. Outside of academics PCs still<br>
play a pretty important role, and on Windows, BMP files are still the<br>
standard.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and given that we got Cog, it could run just a bit slower, if<br>
implemented in image w/o primitives.<br>
</blockquote>
<br>
Right. &quot;Just a bit&quot;. 10x.<br>
<br>
Cheers,<br>
- Andreas<br>
<br>
</blockquote>
</blockquote></div><br>