Created attachment 373184 [details] A small program which displays the described problem Description of problem: Simple paint routines run under openJDK run horrendously slowly under openJDK when the antialiasing option is given to the graphics object. The same code without antialiasing or run using Sun's JRE runs very quickly. Version-Release number of selected component (if applicable): java-1.6.0-openjdk-1.6.0.0-33.b16.fc12.x86_64 jre-1.6.0_15-fcs.x86_64 How reproducible: Always Steps to Reproduce: 1.Run the attached program to do 10 redraws of a fairly complex scene with aa Actual results: From the openJDK with AA 10 refreshes take ~14000ms. From the openJDK without AA 10 refreshes take ~300ms From the Sun JRE with AA 10 refreshes take ~750ms From the Sun JRE without AA 10 refreshes take ~300ms On the antialiased results the openJDK is about 20X slower than the sun JRE. Expected results: OpenJDK and Sun JRE take about the same amount of time. The overhead for AA is of the order of 2X. Additional info: This appears to be a regression which happened some time during the F11 timeframe. We suddenly noticed a drop in our application's performance and found it could be fixed by using the Sun JRE. Until then we'd been happily using openJDK. It's only now I've tracked down the source of the problem. If it matters, our machines all run Nvidia graphics cards, but this problem has been reproduced under the nvidia binary drivers and the open source nv and nouveau drivers - so I suspect it's not related directly to hardware.
I pushed a changeset to openjdk7 meant to improve anti aliasing performance (among other things). http://hg.openjdk.java.net/jdk7/2d/jdk/rev/d47bd9d94ba4 is the link to it. I ran some tests on my machine with the given reproducer, and these are the results I got: | openjdk 7 without | 7 with my | | | my change | change | openjdk6 | sun jre ------------------------------------------------------------------ time (ms): | 7450 | 2500 | 15000 | 550 So, as can be seen, although my patch improves things, most of the improvements come from just openjdk7 itself (7450 ms vs. 15000 ms). I noticed that in the reproducer g.drawLine is used to draw the lines. In these cases drawlines should be avoided, if possible. It is much faster to make a Path2D, put all the lines to be drawn in it, and render them all in bulk. I re-ran the tests with g2.draw(path) instead of g.drawline, and these are the results: | openjdk 7 without | 7 with my | | | my change | change | openjdk6 | sun jre ------------------------------------------------------------------ time (ms): | 3000 | 2000 | 4000 | 1000
This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '12'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug is still present on a fully updated F13 machine. java-1.6.0-openjdk-1.6.0.0-43.1.8.2.fc13.x86_64 Using the test program I attached before the stats were: OpenJDK No AA 278ms SunJRE No AA 271ms OpenJDK With AA 9715ms <<- This is the problem SunJRE With AA 726ms
Hello Simon. I'm sorry about this. My fixes haven't made it into F13 yet, so that's why it's still slow. They should be there on the next update of icedtea though. When I run your program I get 13000ms with openjdk6. When I run it with openjdk7 with my fixes it runs in 1900ms. You won't see this drastic of an improvement because you'll still be using jdk6, but the improvement should still be considerable, and I'm still working on new performance improvements.
This was fixed in icedtea6 head and 1.10 with the backports of the new parallelogram pipes.