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

Quadratic performance regression when creation of nested JAVAFX nodes

    Details

    • Subcomponent:
    • Introduced In Build:
      b01
    • Introduced In Version:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Microsoft Windows [version 10.0.17134.228]

      java version "1.8.0_181"
      Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)


      A DESCRIPTION OF THE PROBLEM :
      Since Java 8u172, severe degradation of performance for creation of nested JAVAFX nodes, even when no style sheet is used.

      This bug is really BLOCKING for our product!
      There is NO WAY for us to upgrade to recent java version (Java 8u181 or Java 10)

      REGRESSION : Last worked in version 8u162

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the attached example with a java profiler.
      Type "300" in text field and measure performance.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Jdk 8u162 : 55 ms
      ACTUAL -
      Jdk 8u181 or jdk10.0.2: 1400 ms!!

      ---------- BEGIN SOURCE ----------
      package perfo;

      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.TextField;
      import javafx.scene.control.ToolBar;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.HBox;
      import javafx.scene.text.Text;
      import javafx.stage.Stage;

      /*
       * To change this license header, choose License Headers in Project Properties.
       * To change this template file, choose Tools | Templates
       * and open the template in the editor.
       */
      /**
       *
       * @author daniel
       */
      public class Perfo extends Application {

          private BorderPane pane;

          @Override
          public void start(Stage primaryStage) throws Exception {
              pane = new BorderPane();
              TextField textField = new TextField("300");
              pane.setTop(new ToolBar(textField));
              textField.setOnAction(e -> {
                  HBox hbox = new HBox();
                  int nb = Integer.parseInt(textField.getText());
                  for (int i = 0; i < nb; i++) {

                      hbox = new HBox(new Text("y"), hbox);
                      final HBox h = hbox;
                      h.setPadding(new Insets(1));
                  }
                  pane.setCenter(hbox);

              });

              Scene scene = new Scene(pane);
              primaryStage.setScene(scene);
              primaryStage.sizeToScene();
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      NO BYPASS

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arapte Ambarish Rapte
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: