The Plasma2 Benchmark

Source

This applet creates an animated display by continuously summing sine waves into an array and drawing the array on the screen. The number of frames displayed per second is shown in the upper left corner.

This applet demonstrates that Mac OS X Java is unable to draw indexed color images to the screen as quickly as other versions of Java. It is a test case for a bug report that was submitted to Apple (bug #2831485). It is also available as an ImageJ plugin. ImageJ displays 8 bit, 16 bit and float images in the same way as this applet so it should run faster on OS X when Apple fixes this bug.

If Apple is interested in speeding up Java image drawing on OS X the should concentrate on com.apple.mrj.internal.awt.graphics.CGPen.CGDrawImage, where this applet spends 53% of its time and on sun.awt.image.ImageRepresentation.setPixels, where it spends 25% of its time.

FPS System Viewer
539 Intel-Mac/3.0, OS X Java 1.5, Applet Viewer
453 P4/2.8, Win XP Java 1.4.2, IE 6.0
321 P4/3.0, Win XP AppletViewer, Java 1.4.2
180 P4/3.0, Win XP Microsoft Java, IE 6.0
84 G5/2.0x2, Mac OS X Java 1.4.1, Safari
53 G5/2.0x2, Mac OS X Java 1.3.1, Mozilla
52 P3/400, Win XP JDK 1.4.2, appletviewer
32 G4/400, MacOS 9 MRJ 2.2.5, IE 5.0
26 P3/400, Win XP JDK 1.1.8, appletviewer
16 G4/400, MacOS X v10.2.7, Java 1.4.1, Safari


Credits

The plasma generation routine was contributed by Sam
Marshall (t-sammar@microsoft.com). The modifications to
use an 8-bit image with indexed color model were contributed
by Menno van Gangelen (M.vanGangelen@element.nl).
Improved frame rate calculation and code for using
MemoryImageSource.setAnimated() contributed by
Andy Sy (andy@mindgate.net).