JavaFX 2.2 Performance
JavaFX is a really powerful UI platform. I noticed a lot of momentum in Java as client technology. As JavaFX is now clearly the successor of Swing I will give it a try.
I have created the Visual Programming Environment VRL-Studio with Swing. I added a lot of features to the rendering/animation/effects pipeline. But for the next version I think of switching to JavaFX. But before I start with the real implementation I want to be sure that the performance is ok. Unfortunately, JavaFX still has some critical issues that are hopefully resolved in the near future.
Issues
Performance seems to heavily depend on the graphics card/driver/OS. Even more important, the framerate of a JavaFX application drops as the size of the application stage increases. This does not only happen if nodes are drawn on the whole application window but also if only a part of the window shows content. If your application runs on a large screen, e.g., a 27″ iMac (2880×2560), this does really matter.
Questions
Does JavaFX use dirty region optimization such as Swing?
Does it use additional image buffers like JCanvas3D in Java3D does?
This would be a good explanation for the fps drop. I have the feeling that the delay introduced by increased window size is independent from the number of nodes in the sceenegraph.
The Benchmark
- perform the bubblemark (uses only wall collision)
- add more balls
- increase the window size and start with
1.
again
After several runs the benchmark stops and writes the results to statistics.txt
.
Screenshot
In the application screenshot you can see that all balls stay in a small box inside the application window.
Benchmark Results
In this figure you can clearly see that the framerate drops if the stage size increases even though all balls stay in the same region. This behavior could be reproduced on Intel HD 4000 (OS X 10.8) and AMD ATI Radeon HD 5750 (openSUSE 12.2).
The x axis shows the number of runs (window size increased each run). The average framerate is shown on the y axis. For the test the VM flag -Djavafx.animation.fullspeed=true
was used to get full performance.
Download Source
You can download the source from GitHub.com