1 Reply Latest reply on May 21, 2013 9:03 PM by jsmith

    XYChart Plot Limit?

      Hello, I have recently taken up JavaFX in hopes of creating a general purpose graph generator for use with large data sets. However, I have noticed that after ~30,000 or so plots, the graphs take a while to render (meaning not seemingly instantaneous). I was hoping to get at least 100,000 without experiencing this delay. Could it be that I am doing something wrong? Or are the XYCharts not made to handle such large plot counts? I have googled around and the only suggestions I have found and tried were to use the Task class or to put the code wrapped in a Platform.runLater call to put it on the JavaFX thread. Thanks in advance.
        • 1. Re: XYChart Plot Limit?
          100,000 is lot of plots, so there may be an upper acceptable performance limit that the standard JavaFX charts can handle which is lower than that. The standard charts may not have been designed with that size target dataset in mind.

          Are you running on a machine with a high quality supported graphics card and fast cpu?

          Does performance improve if you use a 64 bit or server VM?

          Have you tried Java 8?

          Performance of many things is significantly improved in Java 8.
          The default styling for charts was simplified in Java 8 to remove things like drop shadows on line charts (which would significantly impact performance of large data sets).
          I think the simplification of the default chart styling was so that charts perform well on limited resource embedded devices, but I think the simplifications should also result on significant performance increases on non-embedded devices as well.

          Have you done any profiling to see where the bottlenecks are. If not, try profiling the chart with jprofiler:

          When profiling it will probably help to have the JavaFX source on the path so that the profiler has access to the debug information it may need for accurate profiles:

          Previous analysis of JavaFX tasks have found that rendering of complex paths is significantly slower than rendering primitives such as lines and rectangles.
          You may be able to subclass XYChart to create a high speed plotter that uses only line and rectangle primitives and none of the default css styled regions and path elements - making it far more capable of rendering large data sets with optimal performance.

          I have had no issues rendering 60fps 60000+ polygon phong shaded 3D models on Java 8 on a Macbook Air with an Intel 1.8ghz processor and HD4000 graphics (a low end integrated ultra-mobile graphics chip). 3D is a a completely different rendering pipeline than the 2D charts, so probably not that relevant to 2D chart plots, but it does at least show that the performance is there if a way can be found to harness it. Also perhaps you could subclass XYChart and render the plot points in a mesh within a 3D hardware accelerated sub-scene. If you do this, please publish the code as I would like to see it :-)

          Creating a short executable sample which allows somebody to replicate your issue will likely result in receiving more assistance:

          If you still have further questions after trying the above, you might want to cross post to the JavaFX development list where some of the JavaFX developers may be able to better advise you.

          You may want to vote for the following open tweak request:
          https://javafx-jira.kenai.com/browse/RT-20405 "Improve Path rendering performance"

          Also see comments regarding path rendering performance on:
          https://javafx-jira.kenai.com/browse/RT-20857 "Poor Path rendering performance"
          1 person found this helpful