We're playing with some new icons for VisualWorks. And if you're going to do that, there's no sense doing so, unless you're going to support alpha blending.
So I spent Friday making tests for an AlphaCompositedImage pass. And then looked at some numbers today. My implementation was "clean room" inspired by the work Runar Jordahl did in the past.
In the case where the palettes can be matched, the composition can go quickly. On my VMWare hosted Vista, I can lay down 16x16 icons about 150 usecs a piece. This is actually pretty impressive for a language that doesn't bash bytes well. We keep the speed up there by reusing the backing buffer. So I'm getting about 70% of the time spent in display primitives. I don't know how the numbers will pan out for OSX or X11. They could vary quite a bit.
Anyone who knows me, knows I'd really like to do this with Cairo. Interestingly, Cairo ImageSurfaces using the HigherGlyphics package are about the exact same speed. So I'm relatively pleased with the VisualWorks numbers. Again, I wonder how the race would pan out on Linux or X11.
Where the race spreads out is when we go to larger graphics. Using a large 400x500 png, Cairo outstrips the all-in-Smalltalk implementation by about 5:1. And of course, Cairo can rotate those 16x16 icons at any angle, and the speed hit is barely noticable (about 5%).