{"id":280,"date":"2012-09-27T22:53:22","date_gmt":"2012-09-27T20:53:22","guid":{"rendered":"https:\/\/mihosoft.eu\/?p=280"},"modified":"2013-02-07T22:57:02","modified_gmt":"2013-02-07T21:57:02","slug":"javafx-2-2-performance","status":"publish","type":"post","link":"https:\/\/mihosoft.eu\/?p=280","title":{"rendered":"JavaFX 2.2 Performance"},"content":{"rendered":"<p>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.<\/p>\n\n<p>I have created the Visual Programming Environment <a href=\"http:\/\/vrl-studio.mihosoft.eu\">VRL-Studio<\/a> 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.<\/p>\n\n<h2>Issues<\/h2>\n\n<p>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&#8243; iMac (2880&#215;2560), this does really matter.<\/p>\n\n<h2>Questions<\/h2>\n\n<ul>\n<li><p>Does JavaFX use dirty region optimization such as Swing?<\/p><\/li>\n<li><p>Does it use additional image buffers like JCanvas3D in Java3D does?<\/p>\n\n<blockquote>\n  <p>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.<\/p>\n<\/blockquote><\/li>\n<\/ul>\n\n<h2>The Benchmark<\/h2>\n\n<ol>\n<li>perform the bubblemark (uses only wall collision)<\/li>\n<li>add more balls<\/li>\n<li>increase the window size and start with <code>1.<\/code> again<\/li>\n<\/ol>\n\n<p>After several runs the benchmark stops and writes the results to <code>statistics.txt<\/code>.<\/p>\n\n<h2>Screenshot<\/h2>\n\n<p>In the application screenshot you can see that all balls stay in a small box inside the application window.<\/p>\n\n<div id=\"attachment_296\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01.png\"><img aria-describedby=\"caption-attachment-296\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01-300x196.png\" alt=\"\" title=\"fxbenchmark01-screenshot-01\" width=\"300\" height=\"196\" class=\"size-medium wp-image-296\" srcset=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01-300x196.png 300w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01-1024x669.png 1024w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01-700x457.png 700w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-screenshot-01.png 1184w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-296\" class=\"wp-caption-text\">Screenshot<\/p><\/div>\n\n<h2>Benchmark Results<\/h2>\n\n<p>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). <\/p>\n\n<div id=\"attachment_291\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01.png\"><img aria-describedby=\"caption-attachment-291\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01-300x197.png\" alt=\"\" title=\"fxbenchmark01-01\" width=\"300\" height=\"197\" class=\"size-medium wp-image-291\" srcset=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01-300x197.png 300w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01-1024x672.png 1024w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01-700x459.png 700w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01.png 1343w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-291\" class=\"wp-caption-text\">Framerate for different Window Sizes<\/p><\/div>\n\n<p>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 <code>-Djavafx.animation.fullspeed=true<\/code> was used to get full performance.<\/p>\n\n<div id=\"attachment_302\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fx-benchmark01-workflow-01.png\"><img aria-describedby=\"caption-attachment-302\" decoding=\"async\" loading=\"lazy\" src=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fx-benchmark01-workflow-01-1024x553.png\" alt=\"\" title=\"fx-benchmark01-workflow-01\" width=\"700\" height=\"378\" class=\"size-large wp-image-302\" srcset=\"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fx-benchmark01-workflow-01-1024x553.png 1024w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fx-benchmark01-workflow-01-300x162.png 300w, https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fx-benchmark01-workflow-01-700x378.png 700w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><p id=\"caption-attachment-302\" class=\"wp-caption-text\">VRL-Workflow for analyzing the statistics.txt file<\/p><\/div>\n\n<h2>Download Source<\/h2>\n\n<p>You can download the source from <a href=\"https:\/\/github.com\/miho\/FXBenchmark01\">GitHub.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230;<\/p>","protected":false},"author":1,"featured_media":291,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[13,21,5],"tags":[22,124,23,125,24],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/mihosoft.eu\/wp-content\/uploads\/2012\/09\/fxbenchmark01-01.png","jetpack_shortlink":"https:\/\/wp.me\/p2P2yR-4w","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/280"}],"collection":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=280"}],"version-history":[{"count":31,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/posts\/280\/revisions\/311"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=\/wp\/v2\/media\/291"}],"wp:attachment":[{"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mihosoft.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}