Loudtalks — internet walkie talkie

JavaFX — very cool, very slow

By Alexey Gavrilov on July 18, 2007

JavaFX benchmark

JavaFX has been the only RIA technology missing from the set included in Bubblemark. Not any longer. I built JavaFX version of the test, which uses JavaFX markup (i.e. vectors not bitmaps) for balls rendering and therefore compares directly to WPF, Silverlight and Flex.

Check out the JavaFX demo, deployed using Java Web Start here.
Here is the source code.

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 + Silverlight (JavaScript) — 56 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!

Chris Oliver’s early benchmarking results of JavaFX compiler suggest that there is a hope it could.

(update 08/27/07: Chris Oliver responds in his blog showing how you can make JavaFX bubblemark 5x faster! Here is his version and the source code.)

Share this!
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Technorati
  • Furl
  • Slashdot
  • BlinkList
(categories: Technology, Solutions box)

26 Comments »

  1. FYI, it fails on OS X 10.4.10 — at least it does for me. I’ve pasted the exception data here: http://dpaste.com/hold/14747/

    Comment by Paul — July 18, 2007 @ 7:42 pm

  2. They are working on a compiler and they already have 60x speed improvement on code execution. Also, the scene graph library (Picolo) currently used by Java FX will very likely be replaced by another one, more efficient.

    Comment by Romain Guy — July 19, 2007 @ 12:07 am

  3. By the way. Does anybody have iPhone to try some of Bubblemark tests on it?

    Comment by Alexey Gavrilov — July 19, 2007 @ 2:48 am

  4. […] I just caught that Bubblemark, which is quickly becoming the RIA benchmark source added a test for JavaFX. So now with the Bubblemark tool you have the source and the applications to compare a variety of RIA technologies. According to the post, JavaFX is really slow, but it’s still in super-alpha and he points to a link that indicates the team is working on making it faster. According to Alexey, this is how it stacks up: JavaFX — 14 fps Firefox + Silverlight (JavaScript) — 56 fps Firefox + Flex — 62 fps Adobe AIR — 62 fps Firefox + Silverlight (CLR) — 99 fps […]

    Pingback by » Bubblemark RIA Benchmark Now Does JavaFX, AIR, Silverlight, and Flex | The Universal Desktop | ZDNet.com — July 19, 2007 @ 4:10 am

  5. […] JavaFX RIA Test Added to Bubblemarket RIA Benchmarks July 18th, 2007 — drawk Bubblemark has added a JavaFX version of his bubble animation test that spans now all of the RIA technologies out there. Bubblemark is a great site and has been a great site for comparing animation in the browser. Alexey Gavrilov has kept the site up to date on all versions of Silverlight since when it was WPF/E and it is a nice quick baseline test to check FPS performance across these new vector toolkits and scripting. […]

    Pingback by [ draw.logic ] JavaFX RIA Test Added to Bubblemarket RIA Benchmarks « — July 19, 2007 @ 6:09 am

  6. And you’re not even showing javafx’s atrocious memory usuage. It would probably be around 10x worse than the other technologies. MVM Sun. MVM!!!!

    Comment by buba — July 19, 2007 @ 8:48 am

  7. […] Bubblemark, a simple 2D animation demo, is becoming a code sample to compare performance of different RIA frameworks. They now provide on their website about 7 tests, including a recent JavaFX test, that concluded in very low values. […]

    Pingback by Fábio Pedrosa » JavaFX - very cool, very slow — July 19, 2007 @ 2:03 pm

  8. does Silverlight uses DirectX by default on Windows in your example and any other?

    if that is so then difference between Silverlight and Flash is normal and I could say then that Flash is performing very good

    Comment by MrSteel — July 19, 2007 @ 3:25 pm

  9. As far as I know neither Flash nor Silverlight uses DirectX or any other hardware accelerated APIs.

    The difference is probably more about .NET being faster than ActionScript.

    Still Flash is certainly preforming very good.

    Comment by Alexey Gavrilov — July 19, 2007 @ 3:29 pm

  10. I don’t believe your bubblemark score is comparable to the other scores. Your implementation appears to rerender every ball for every frame using Java2D (basically, vector) while the other implementations use prerendered balls (.png files) - at least, the DHTML and the Java Swing versions appear to. It is MUCH faster to blit a prerendered ball than it is to draw an antialiased vector image. This JavaFX version is not an equivalent benchmark to the others. Try revising it to use prerendered balls and see what your numbers end up looking like.

    Comment by Andy D. — July 19, 2007 @ 8:17 pm

  11. It looks like some of the tests on the Bubblemark page use prerendered balls, and some use vector balls. I wonder if the other engines are optimizing by prerendering the vector balls to a back buffer and then blitting that buffer? Whatever the case, I would think the Bubblemark would want to standardize on one or the other (or at least divide the results between prerendered balls and vector balls).

    Comment by Andy D. — July 19, 2007 @ 8:19 pm

  12. @Andy D:

    That’s a good point and in fact I’m planning to divide the tests into two groups just as you are suggesting. DHTML, Java, Flex (with cache as bitmap on) and both AIR demos use bitmaps and the rest — vectors.

    In this post I only compare the results, which are coming from vector-based renderers.

    Lastly I updated Silverlight CLR demo today and now it gives ~200 fps and still uses vectors.

    Comment by Alexey Gavrilov — July 20, 2007 @ 1:03 am

  13. I got asked on my blog, has anyone thought of testing this against Director? I know it is not an “RIA” kit but it does have hardware acceleration in some cases. It is still the 3d game champ online but it seems to have been forgotten.

    Comment by Ryan Christensen [draw.logic] — July 20, 2007 @ 4:25 am

  14. Using the Flash player beta, 9,0,60,120 - available for d/l on labs.adobe.com, I got 201 fps on my similar dell laptop.

    The next versions of Flash will use DirectX See Tinic’s blog. He’s an engineer working on the flash player.

    http://www.kaourantin.net/2007/06/flash-player-update-3-beta-1.html

    I think when considering which RIA tools are the best for the job, one should also take into account the speed and/or rendering that will be needed once an app begins. If you’re looking into Flash/Flex, here are some good benchmarks for getting data in/out of an app and how it that compares an AJAX/DHTML app.

    http://www.jamesward.org/census/

    Thanks for the post!

    Comment by Michael Kaufman — July 24, 2007 @ 2:33 am

  15. @Michael:

    Thanks a lot for the comment and useful links!

    I tried 9,0,60,120 but didn’t notice a performance gain with the Flex demo, which uses vectors-based rendering (http://bubblemark.com/flex.htm).

    Could it be that you tested the version with cacheAsBitmap=true (http://bubblemark.com/flex_bmp.htm)?
    It shows 190 fps with 9,0,60,120 beta, up from ~90 fps with the previous one.

    Comment by Alexey Gavrilov — July 24, 2007 @ 4:55 pm

  16. Not having looked at the underlying code, there must either be a problem (or unnecessary complication) with the implementation or with the JavaFX compiler/renderer. There’s no reason the Swing implementation should be able to render at four times the rate of JavaFX.

    Comment by colonel35 — August 1, 2007 @ 6:36 am

  17. @colonel35:

    It’s neither from two. Java and JavaFX versions are simply different. Java renders balls as bitmaps and JavaFX as vector graphics (via JavaFX markup). That’s why Swing results aren’t included in the comparison on this page.

    Comment by Alexey Gavrilov — August 1, 2007 @ 11:23 am

  18. […] Hemen hemen herkes Sun Microsystems‘ın Nisan 2007′de duyuduğu yeni görsel teknoloji dili olan JavaFx‘i duymuştur. JavaFx, enterprise pazarda yeniden var olmak isteyen Sun’ın Java’yı kurtarmak için sunduğu son çözümdü. İlgi çekici, çok karmaşık olmayan bir dil ile — DOM ve CSS’den esinlenmiş — harikalar yaratılabileceğini göstermek istiyorlardı. Yani paket oldukça şıktı fakat kişisel deneyimlerim sonucu dilin katlanılamayacak kadar yavaş bir yüklenme süresinin olduğunu kararını verdim. Ayrıca Metalink‘de bu konuyla ilgili yapılmış istatistiksel gözlem performansın ne kadar düşük olduğunu matematiksel olarak ispatlıyor: […]

    Pingback by Burcu Doğan’ın kişisel blogu » Blog Archive » JavaFX - Performans Analizi — August 15, 2007 @ 6:06 am

  19. […] This is my first experience writing for a magazine (right, it’s online only but still a very different genre from blogging) and overall I think it was the great exercise. I learned JavaFX basics while working on it, and built JavaFX version of the bubblemark consequently. Share this! These icons link to social bookmarking sites where readers can share and discover new web pages. […]

    Pingback by Metalink » Quick starts for AIR, Silverlight, and JavaFX — August 28, 2007 @ 4:16 pm

  20. […] By the way, if this demo looks at all familiar, I “borrowed” the idea from the Bubblemark benchmarking application. I like to “borrow” stuff. […]

    Pingback by 10 Minute Tutorial - Silverlight: Using JavaScript to Call Scriptable Managed Code (C#) at Die, AJAX! — September 16, 2007 @ 10:06 am

  21. I wrote a similar article on javafx - cool idea, but very strange approach to RIA and not at all what AJAX is all about. Article is here:

    http://www.keeneview.com/2007/09/really-idiotic-approaches-to-ria-flex.html

    Comment by ckeene — September 22, 2007 @ 10:08 pm

  22. nicer benchmark test for JavaFx -

    http://molgav.nn.ru/index.php/javafxmenu/34-example/58–javafx–html

    Comment by 1024 — October 15, 2007 @ 3:39 pm

  23. Sun / Java is the Worlds worst co. when it comes to UI. I was in Java for 4 yrs in my initial Dev days, and after knowing .NET in it’s beta stage, several of my friends and myself moved to .NET & C#. The only reason was Sun’s lack of Tool support and it’s time to release anything new. It was 2001, when JSF was started in paper. But, cameout in 2006/2007 as a release version. So, i dont think JavaFX wont be released for next 3-4 yrs.

    Why i said Java is not a technology for UI, it’s sluggish performance. I just clicked the above JavaFX demo, when i saw the code, i thougt still Sun / Java is in the same stage. for 1 single button in oval shape, if we’ve to write these many 100’s of lines, which customer is going to pay for it. No one.

    Also, when i selected 12.5% in the dropdownlist, the entire window started flickering 100 times/sec. I thought i messed up my system. Thank god, i managed to go to TaskBar and killed the so called JavaFX Pad.

    Bottomline, let Java & Sun should know their limits and keep their concentration in midtier and let other Co’s like BEA/IBM/Oracle have the App Server developed for them.

    Let God save Java.

    Jinishans

    Comment by jinishans — May 16, 2008 @ 7:17 pm

  24. Excellent update! its now going at 109fps! thats awesome! JavaFX is coming along nicely

    Comment by Chris — August 31, 2008 @ 6:31 am

  25. (5 November 2008)
    I am a Swing developper.
    I wanted (for years) to do nice visual things like Flash animation. And I could not.
    So, of course I read your article about javaFx.
    It scared me a bit.

    I did try javaFx for 2 days.
    And frankly I really like it.
    javaFx script is the java langage without the “complicated not so nice things”.
    I love the bind operators that let the gui change if the value change AUTOMATICALY.
    I find javaFx script to be compact and nice.
    I still write java simple code. But with ease and good productivity.
    And the guis javaFx produces are really Flash like things. Good looking.

    And what about the rendering speed…… Well I have been testing against the new java 1.6 update 10 …. so perhaps this is why I find it quite quick. For me rendering speed is bery ok.

    Voila, I felt I had to had my honest testing imput on this thread.

    I just hope people view javaFx for what it really is : a nice Swing++ version.

    PS:
    Le’s put it this way : Sun has been sleeping with aplets and swing for the last 4 years, leaving java gui developpers with anger.
    Today sun is catching up with Internet RIch java gui (with Flash not to name it). And I feel they have done a good job.

    Comment by Thierry — November 6, 2008 @ 2:13 pm

  26. Dear Thierry

    Things ok for u dont mean anything, they should be ok for the users.

    Guess what the JVM made me wait for about 30 seconds and then nothing happened.

    No bubbles on my machine, though every other program works perfectly here on my Ubuntu.

    Comment by LogicallyGenius — January 22, 2009 @ 5:34 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment