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.

I have the honor to be joined by Mike Swingler (Swing / AWT lead for Apple VM) and to present an evening session on high resolution monitors at this year’s JavaOne. This has been in making since even before last year’s conference, and i am grateful to Jeff Dinkins that put me in touch with Mike.

Here is a short overview of what we’re going to talk about:

  • Introduction – general overview of the field, including terms (pixels, points and in between), a few examples of high-resolution monitors and the reasons why this matters.
  • Broken applications – visual artifacts in mainstream applications running in high resolution mode on Windows XP, Windows Vista, Ubuntu Gnome and Mac OS X.
  • Scaling modes – three main modes that different UI toolkits (such as WPF and Cocoa) provide for scaling the UIs. Each one has its advantages and requirements from the UI developers.
  • Testing your app – how to test your application under high resolution mode on the usual displays.
  • Swing tips – things to do if you’re developing a Swing application.

Mike brings in his expertise from the framework perspective (and very interesting things available in Leopard for both Cocoa and Swing), and i will be talking about the low-level details of scaling application visuals, touching on such subjects as icons, control visuals, layout metrics and more. If you’re interested in this topic, please join us next Tuesday at 9:30 PM. The session number is BOF-5037 and it will be held in Hall E 135. See you then.

Here are some Swing links that you might have missed during this week:

  • Richard Kennard has announced release 0.43 of his Metawidget project. Geertjan Wielenga picks this up on the DZone, and Dieter Krachtus has engaged in an architectural discussion on the project. Richard also shows how Metawidget can emit JIDE components.
  • Jan Erik Paulsen vents his frustration with some of the Swing pain points, including layout managers, audio / video support and JavaFX design tools vision. Over the past year Jan Erik had a number of very interesting projects, including Capture, Photoshop Express and Amanda, and it looks like the topics above have hindered the progress of these projects to some degree.
  • Eugene Toporov announces release 1.0 of commercial JxBrowser library for embedding Mozilla Firefox browser into AWT / Swing applications.
  • Ingo Maier announces release 0.1 of scala.swing, an event based library for building Swing applications in Scala.
  • Jacek Furmankiewicz continues his explorations of Java builders for Swing layouts, and it looks like this approach strikes a chord with his readers (see followup by Andres Almiray).
  • Continuing the trend of Swing as a “UI virtual machine” for JVM-based dynamic languages, Greg Trasuk experiments with project JyMatisse that allows using Jython as the backend for Matisse-generated forms.
  • And finally, Christophe Le Besnerais has published a Swing component for cropping images. The ability to install a custom filter (illustrated by grayscaling and blurring the outside of the cropped area) is especially impressive, and my only concern is using JLayeredPane as a base class. Perhaps using JPanel with OverlayLayout can be a simpler solution?

The first volume of Substance sightings was published last August and featured four Swing media-oriented applications. The purpose of this series is to highlight the capabilities that Substance look-and-feel brings to Swing applications, and the second volume showcases three open-source audio players with Substance-powered UI.

The first audio player is aTunes (hosted on Sourceforge as well), and it takes advantage of a few Substance APIs. Here is a sample screenshot of aTunes under the dark Raven skin (click to see full-screen image):

And here is another aTunes screenshot under the Business Black Steel skin. Note that both screens use vertically rotated tabs (in the top left corner) and the status bar component from SwingX component suite rendered by the Substance SwingX plugin:

The final aTunes screenshot shows the UI under Arabic locale. Note how Substance handles the right-to-left orientation of title pane buttons, menus, sliders, table headers and tabs:

The second player is Jajuk (which is also hosted on Sourceforge). Here is a screenshot of Jajuk in action – note how it uses an image-based watermark:

Unlike aTunes, Jajuk uses a few custom components that are not painted by Substance (the title bars of inner docked views and some of the buttons).

The last one is Xtreme Media Player (also hosted on Sourceforge). Unlike aTunes and Jajuk, Xtreme MP uses a custom Substance skin to create a unique look for the application. Here is a screenshot of XtremeMP in action:

This application uses SwingX and the matching Substance SwingX plugin as well (for the status bar). In addition to a custom Substance skin, it also takes advantage of the Substance button shaper functionality, setting custom button shapers on the control panel buttons:

Once the application defines the contour of each button, Substance takes care of the rest, including mouse hit detection and proper animation sequences.

If you haven’t tried Substance in your application, you’re more than welcome to do so. The current stable release is 4.3, and the next 5.0 version is available in early development drops.