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

Rendering performance degradation at bottom of TableView with many rows

    XMLWordPrintable

Details

    • b21
    • generic
    • generic

    Backports

      Description

        ADDITIONAL SYSTEM INFORMATION :
        Checked on Windows, Linux

        A DESCRIPTION OF THE PROBLEM :
        When a table has many rows, there is a noticeable performance degradation when rendering bottom of the table.

        Works fine when showing upper part of the table.
        Problem occurs on version 19-ea+9 and up.

        REGRESSION : Last worked in version 18.0.2.1

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        TableView with many rows:
         - scroll to the bottom
         - try to resize window, or select one row and then press (and hold) up/down arrow to select other rows
        You should see lagging during window resize, selecting rows or table scrolling


        ---------- BEGIN SOURCE ----------
        public class App extends Application {

            @Override
            public void start(Stage stage) throws Exception {
             List<String> rows = IntStream.rangeClosed(1, 1000_000).boxed()
             .map(i -> "row-" + i)
             .collect(Collectors.toList());
            
                TableView<String> tableView = new TableView<>();
                TableColumn<String, String> tc = new TableColumn<>("column-1");
                tc.setCellValueFactory(p -> new ReadOnlyStringWrapper(p.getValue()));
                tc.setPrefWidth(200);
        tableView.getColumns().add(tc);
        tableView.setItems(FXCollections.observableArrayList(rows));

                var scene = new Scene(new StackPane(tableView), 250, 200);
                stage.setScene(scene);
                stage.show();
                
                tableView.scrollTo(rows.size());
            }

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

        }
        ---------- END SOURCE ----------

        FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

                jvos Johan Vos
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: