Hi

I've modified the filter code I posted yesterday to remove all function
calls for the inner loops. This speeds it up by a factor of 12 or so.

The code is probably a poster child for how not to write BufferedImageOps,
because it makes several profound assumptions about the layout of the data
buffers for a couple of different sample models, but the need for speed, and
all that. Speaking of speed, being 100% Java, and very 'loopy', it should be
a good candidate for Hotspot, and indeed after (quite) a few calls to the
filter() method, Hotspot kicks in and it gets 20 times faster than -Xint
mode. However, this only puts it on a par with the 1.2.1 JIT (220ms for an
800 X 800 image, or 340ns/pixel, on a 400MHz Celeron), so that's a little
disappointing. (On the other hand, the code I posted yesterday runs 4 times
faster under Hotspot than the JIT, presumably because it has many more
inlining opporttunities.)

Cheers,
Pete

http://www.best.com/~petec

=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/

Reply via email to