JavaFX Scenegraph Performance Revisited
By Jim Connors 8 November 2009
Prior to the release of JavaFX 1.2, an earlier blog post explained how creating an application with a scenegraph containing a large number of nodes can have performance implications. That entry was subsequently picked up by Java Lobby and recently posted here. Partly because it was a few months old, it resulted in a rash of, shall we say, interesting comments.
As one commenter pointed out, the initial results represent
JavaFX performance in the 1.0/1.1 timeframe. JavaFX 1.2 has
since been released, and performance has improved
substantially. As a case in point, you can click on the
image below to run the clock application. This same
application, developed and compiled with JavaFX 1.1 can be run
from the previous blog post. Further instructions are there.
This application, compiled with JavaFX 1.2 and run on identical
hardware, uses about a third of the CPU resources of the original
version. Specifically, using OpenSolaris vmstat(1M)
to monitor CPU usage, the following average statistics were
collected for one minute when the clock display is updated every
10th of a second. The abbreviations have the following
meanings:
And here are the utilization numbers:
Version | # Nodes per Digit |
CPU Utilization |
BulbClockNode JavaFX 1.1 |
27 BulbNodes |
us: 22% sy: 2% id: 76% |
BulbClockNode JavaFX 1.2 | 27 BulbNodes | us: 7% sy: 2% id: 91% |