BMP Writing Performance

Andreas Raab andreas.raab at gmx.de
Wed Apr 2 00:13:27 UTC 2003


Eddie,

> 1500 ms is good enough for me, but it can certainly go faster 
> as a plugin. I see that BMP reading has a plugin already, and
> its very fast. Should I add a plugin method for writing?
> Personally, I'd rather see less plugins than more, all things
> being equal. Hopefully, in the long run, a robust vector
> library (ByteArray etc) would be a better alternative for many plugin
> candiates.

True and we don't have it yet ;-( If you want to do this what you should be
doing is to write the "inverse" of the existing primitive - e.g., take
what's there (literally!) and simply change the inner loop which copies the
pixels to do the exact opposite: Instead of reading 3 bytes and write a
word, read a word and write three bytes. Note that the existing primitive
checks all of the invariants you'd have to test for already - so you can
really just go for the inner loop.

[Extra note: I consider this a *perfect* place to start if you want to learn
something about plugin programming. The task is simple, it's definitely
valuable, small enough that it can get integrated right away. You'll have to
"go through the motions" of plugin building you can study the existing code
see what it checks, why this is needed what the failure code in Smalltalk
should be doing etc]

Cheers,
  - Andreas




More information about the Squeak-dev mailing list