By user12610627 on Aug 25, 2007
The first thing you’ll notice is that it’s very slow. The demo takes a very long time to load and start, and real time performance is disappointing. Here is how it compares:
JavaFX — 14 fps
Firefox + Flex — 62 fps
Adobe AIR — 62 fps
Firefox + Silverlight (CLR) — 99 202 fps (update: 202 fps after fixing main timer’s latency)
(All tests were performed on Pentium M 1.7 machine under Windows XP SP2)
It is 4.4x slower than Flash and 7x 14x slower than Silverlight (CLR-based variant).
On a positive side, development with JavaFX is fun, the language is very compact and efficient for building complex dynamic layouts. There is a great converter to JavaFX from SVG format and JavaFXPad is done nicely too.
If only it were 5x faster!
Of course, our intention is to provide hardware-accelerated vector graphics and compile JavaFX script to JVM bytecode getting the full benefits of the hotspot virtual machine, and to provide an improved deployment system, and we're working on that.
The Bubblemark performance described above is caused by
- Download time - size of the deployment unit - The bubblemark JNLP doesn't use pack200 compression so the download of the JavaFX runtime + the app is ~2.1 MB
- Performance of the JavaFX interpreter in doing the collision detection - which is currently probably 50-100 times slower than doing it in Java
- Lack of caching or hardware acceleration of the vector graphics and gradients that make up the ball
- Use pack200 compression for the Jar files
- Do the collision detection in Java code
- Cache the vector graphic at the application level - since once created it's static in this application
Below's a version of Bubblemark in JavaFX that does that.
Here's a link to the source code