Here are some Swing links that you might have missed during this week:
- Christophe Le Besnerais has a custom implementation of Paint interface to paint a glossy button with arc-shaped gradient. Paint is one of the more advanced concepts in Java2D and it’s tricky to create a performant implementation. The only visual thing that is missing for here in the whole “web 2.0” concept is the soft-clipping along the arc itself (especially visible if you change the value of the third slider that controls the color of the top part. Chris Campbell has written about this problem before, and his solution involves an intermediate image.
- Roman Kennke posts an update on progress of Caciocavallo project that aims to create an AWT implementation for X Window System without using any of Sun’s internal classes.
- Jacek Furmankiewicz continues working on the SwingBuilder project, adding more support for bindings, long running tasks and integration with Commons Validation.
- Hans Muller‘s swan song has been sent to the users mailing list of AppFramework (reference implementation of JSR 296). I have already mentioned that this project has been effectively dead for the last six months, and Hans has quite a long list of to-do things in his posting. This project has been heavily promoted throughout the entire desktop track at JavaOne this week, and even though Amy Fowler assures that it will continue to be developed, it would be wise to wait and see if the words are backed by @Actions :)
- Geertjan Wielenga writes about using Maxim Zakharenkov‘s SwingExplorer inside a NetBeans module.
And some stray thoughts on JavaOne:
- Underpromise and overdeliver. Good example – the playback video support for JavaFX and Java. Bad example – javafx.com.
- I wonder why the video support hasn’t been featured more prominently during the keynote (instead of the frozen single-threaded demos). This is a very significant step forward for client Java, much more so than glitzier eye-candy dragging applets to the desktop. On the other hand, when the hype is that applets are back, who am i to judge?
- I was almost hoping that the video support would address the number one wish i had for desktop Java in 2008 – cross-platform support for H.264 and FLV. We’re still not there yet – the cross-platform codecs are rather unknown in the general desktop area (one from On2, and another from the Open Media Commons project that has yet to deliver any binaries), and H.264 and FLV will only be supported when native codes are installed.
- And no, those were not 200 different video streams mapped on the rotating cube. Those were 200 different views on a handful of different video streams. Still impressive.
- The best presentation that i have attended did not use a single slide from Sun’s template. Those of you who are familiar with work of Garr Reynolds and Nancy Duarte should already know the answer to “why?”, and Ben Galbraith’s reputation has apparently allowed him to swerve past Sun’s lawyers and copywriters to present a very strong, clean and focused talk on user and interaction design.
- And while we’re at it – do we really have to ruin every single session title and slide that use the word Java? I think we can figure out if Java is Java™ technology, Java™ platform or Java™ programming language by ourselves . At least they didn’t turn “Effective Java” into “Effective Java™ Programming Language”…
- Literally bending and picking ugly things off the stage, having dozens of people come and go, showing IDE screens with 50+ lines of code, demoes freezing on the most important day of the year. Makes one wonder why Steve Jobs’ presentations get so much hyped before, during and after…
We’ve just finished presenting our Birds-of-Feather session on high resolution monitors. Thanks to everybody for coming at such a late hour, and thanks to Mike for presenting this session with me. To all of you who attended but want to see the slides once again, and to those of you who couldn’t attend, here are the slides:
Here are some Swing links that you might have missed during this week:
Looking at the comments on the announcement of release 4.3 of Substance look-and-feel, the three major pain points for the users are: performance, performance and performance. You made your statement very clear, and performance improvements were placed as the top priority for the next release (code named Substance 5).
Those of you who visit the Java2D forum on java.net might have seen the discussion between myself and Dmitri Trembovetski, one of Sun’s engineers working on Java2D team. Dmitri has been kind enough to analyze the tracing metrics of Substance, providing very valuable tips on improving the rendering performance. I have been quite busy for the last two weeks working on nothing but the performance area in Substance 5, and i’m very pleased to share the initial results with you.
Substance distribution includes a test application that uses all core Swing controls, checking quite a few scenarios (toolbars embedded in toolbars would be such an example from a real bug report submitted by a user). The distribution also includes a performance suite that selects a few representative tabs in this application (buttons, toggle buttons, check boxes, radio buttons, comboboxes, sliders, table with different renderers; application menu bar, tool bar and tabs are always present). In order to measure the performance, this test frame is rendered to an offscreen image, allowing the look-and-feel to cache all the relevant images (first 10 iterations) and then timing the subsequent iterations.
Here are the results for Substance 4.3 (latest stable release) as compared with native Windows look-and-feel, Nimbus and Plastic3D from JGoodies on a dual-core Vista machine running b22 of 6u10:
- Plastic3D – 34ms with 10.527 KB used heap space
- Windows – 56ms with 10.290 KB used heap space
- Nimbus – 66ms with 25.796 KB used heap space
- Substance – 194ms with 23.353 KB used heap space
As you can see, Substance 4.3 is almost three times slower than Nimbus and 3.5 times slower than Windows look-and-feel.
And these are the results under the latest development drop of Substance 5:
- Plastic3D – 34ms with 10.527 KB used heap space
- Substance – 52ms with 18.549 KB used heap space
- Windows – 56ms with 10.290 KB used heap space
- Nimbus – 66ms with 25.796 KB used heap space
As you can see, version 5.0 is 3.7 times faster than version 4.3, even edging out Windows and Nimbus. It also uses less memory than before (by about 20%) and starts around twice faster. The same range of numbers is observed on a single-CPU Windows XP and Ubuntu 8.04 (running the same b22 of 6u10). The numbers above are for the Autumn skin. Similar improvements are recorded for other core Substance skins, such as Business Black Steel (from 220ms to 73ms), Creme (207ms to 62ms) and Nebula (222ms to 73ms), staying around 3 to 3.7 faster than the previous release.
The next entry will talk more about the specific optimizations that contributed to the performance improvements. You are more than welcome to take the latest dev drop and test it on your applications. There are some minor color inconsistencies on colorized combo boxes, but other than that it should be quite stable and fast.
Note that this is very much work in progress. While all of the current measurements are taken on the software pipeline (still more places left to be optimized), and there is a lot of work to be done for hardware-accelerated pipelines (D3D). The performance suite will be used throughout the development of this version to make sure that there is no performance regression. It will also serve to create guidelines for designing fast custom skins for Substance. Stay tuned for more.