measuring time to render in javafx

Benjamin Gudehus hastebrot at
Fri Jun 2 08:33:37 UTC 2017

Hi Selim,

there was a presentation a while back about PerformanceTracker and the
anatomy of pulses:

   - Oleg Mazurov: “Optimizing JavaFX Applications”

You can activate the pulse logging using Java start parameters.

If you want something more sophisticated like an render indicator in your
GUI you probably need to access private fields/methods in the classes
responsible for the pulse.

Here is a brief overview of the call hierarchy for

   - PerformanceTracker#pulse()
      - Scene#pulse()
      - Toolkit#runPulse()
      - Toolkit#firePulse()
      - QuantumToolkit#pulse()

 And for frameRenderered():

   - PerformanceTracker#frameRendered()
      - Scene.ScenePeerPaintListener#frameRendered()
      - GlassScene#frameRendered()
      - PaintCollector#done(RenderJob)
      - RenderJob#run()
      - QuantumToolkit#addRenderJob()
         - QuantumToolkit#renderToImage(ImageRenderingContext)
      - ViewScene#repaint()
      - PaintCollector#renderAll()
      - QuantumToolkit#pulse()

 And a rough list of start parameters:

   - -Dquantum.pulse=true
   - -Dquantum.debug=trre
   - -Dquantum.verbose=true
   - -Dprism.order=d3d
   - -Dprism.order=sw
   - -Djavafx.pulseLogger=true

(If we had something like the developer tools in modern browsers in JavaFX
10, this would be amazing)


On Fri, Jun 2, 2017 at 10:18 AM, Selim Dincer <wowselim at> wrote:

> Hey,
> I am looking for a way to measure how long it takes for JavaFX to render
> something graphically. Say I change the text of a label, then this will
> schedule a new pulse. How can I now actually get feedback when the
> rendering is done?
> In swing I guess I could override the paint or paintComponent methods. In
> JavaFX I found a hacky way in which I supply a Canvas with my own
> implementation of NGCanvas and then override the impl_createPeer() method
> to return my implementation.
> However this is surely not the way to go and it will break in 9 :-)
> What would be the preferred way of doing this in JavaFX?
> --
> Viele Grüße
> *Selim Dincer*

More information about the openjfx-dev mailing list