Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087358

FXML performance issue with static setters, BeanAdapter methods are slow

XMLWordPrintable

      We noticed that if one uses static setters in FXML, e.g. AnchorPane.bottomAnchor="0.0", there is a substantial performance impact on FXML parsing.
       
      More than 90% of the execution time is spent in these two methods:

      com.sun.javafx.fxml.BeanAdapter.getStaticSetterMethod(Class, String, Class, Class)
      com.sun.javafx.fxml.BeanAdapter.getStaticGetterMethod(Class, String, Class)
       
      a) Parsing an FXML with 100 stack panes in an AnchorPane with static setters takes ~100ms on average on my machine
      b) Parsing an FXML with 100 stack panes in an AnchorPane without static setters takes ~8ms on average on my machine
      c) Creating the same scene tree as in a) programmatically takes ~2ms on average on my machine

            Unassigned Unassigned
            apabstjfx Andreas Pabst (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: