package jira; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.paint.Color; import javafx.stage.Stage; public class RT26137Bench extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { final int parentCount = 100; final int drawCount = 100000; Group parent = new Group(); Scene scene = new Scene(parent); for (int i = 0; i < parentCount; i++) { Group group = new Group(); parent.getChildren().add(group); parent = group; } Canvas canvas = new Canvas(300, 300); GraphicsContext gc = canvas.getGraphicsContext2D(); gc.setFill(Color.YELLOW); gc.fillRect(0, 0, 300, 300); gc.setFill(Color.BLACK); long time = System.currentTimeMillis(); for (int i = 0; i < drawCount; i++) { gc.fillText("some text", 10, 10); } time = System.currentTimeMillis() - time; gc.fillText("parentCount: " + parentCount , 10, 50); gc.fillText("drawCount: " + drawCount , 10, 80); gc.fillText("time: " + time +"ms" , 10, 110); parent.getChildren().add(canvas); primaryStage.setScene(scene); primaryStage.show(); } }