[OpenJDK 2D-Dev] Review Reqeust for Bug 100068 - SunGraphics2D exposes a reference to itself while non fully initialised

Mario Torre mario.torre at aicas.com
Tue Jul 14 12:48:38 UTC 2009

Il 09/07/2009 22:23, Jim Graham ha scritto:

> - pipe interfaces implement a new interface "LoopBasedPipes" which has
> no methods, it is just a "marker" interface. The test in validate() just
> uses instanceof in this case which might be faster than an interface
> method dispatch (actually, it almost certainly would be).

Hi Jim,


I did it with the interface. Actually, I could not spot any real 
difference, but maybe I'm doing a micro benchmark.

I tried to figure out some "common" use case, so i did this (based on 
your suggestion too), I found this combination to force the pipe to be 

BufferedImage bimg =
	new BufferedImage(100, 100, BufferedImage.TRANSLUCENT);
Graphics2D g = bimg.createGraphics();
for (int i = 0; i < 100000; i++) {
                  AlphaComposite.SRC_OVER, 0.5f));
                  AlphaComposite.SRC_OVER, 1.0f));

I do this loop 3 times, so to make hotspot warm up first.
After some runs, I get this as an average (well, manually rounded to be 

warmed up run time in ms: 614
total time in ms: 2189

With "plain" OpenJDK I get similar results.

In both cases I was using debug build (as make debug_build) on an Intel 
Core2 Duo T8300 running at full speed (2.40GHz).

I used the "almost latest" OpenJDK code drop, with changeset ID 

Maybe I should run a more scientific test, but this doesn't look too bad 
to me :)

Mario Torre, Software Developer, http://www.jroller.com/neugens/
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-44
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

Please, support open standards:

More information about the 2d-dev mailing list