Table View causing application lag
See original GitHub issuePrerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Running the latest version of Constellation
- Attached the Support Package via
Help
>Support Package
- Checked the FAQs: https://github.com/constellation-app/constellation/wiki/FAQ
- Checked that your issue isn’t already filed: https://github.com/constellation-app/constellation/issues
- Checked that there is not already a module that provides the described functionality: https://github.com/constellation-app/constellation/wiki/Catalogue-of-Repositories
Description
On large graphs the table view causes Constellation to lock up in particular when switching between graphs.
During debugging one of the issues seems to be that a separate String
object is created for each cell rather than reusing objects. This may be due to the table model underneath storing the values as rows rather than columns. If columns were used then it makes it easier for the build in JavaFX code or our code to optimise how the values are stored for that column. For example the background_icon
attribute could be the same for all nodes and therefore the column could store it once.
Interesting to note that the old Table View which was written in Swing is available from Experimental Views and when that is used instead on the same sized graph, there are no performance issues noticed.
Note that the new table view needs to be closed completely, having it docked or minimised still means that it runs and slows the application down.
Steps to Reproduce
- Create a new graph
- Experimental ->Build Graph -> Sphere Graph
- Set to 50k transactions
- Create a new empty graph (now you should have 2 graphs)
- Open the table view (and notice the memory jump up)
- Constantly switch between the 2 graphs and see the memory go up and lag Constellation
Expected behaviour: The table view should be responsive on large graphs
Actual behaviour: The table view slows down the entire application and sometimes runs out of memory.
Reproduces how often: 90%
Additional Information
The performance issue has to do with the size of the graph, the hardware you are running it on and the amount of memory allocated to Constellation.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top GitHub Comments
I’ve taken a look at this issue and I believe the problem is because the table view produces a new thread to update the table every time the user swaps between the graphs. Each thread will pause at the synchronised lock in the updateColumns method within class TableViewPane, this will cause a build up of threads as each one waits for the previous one to finish reloading the tableView. The original table view doesn’t appear to do this. https://github.com/constellation-app/constellation/blob/375c574b36716eb99f5c627eb486b5fdd22b5cf4/CoreTableView/src/au/gov/asd/tac/constellation/views/tableview2/TableViewPane.java#L597-L601
A potential solution would be to check if there is a previous thread when you go to create a new thread to update the tableView and then end the previous thread.
@arcturus2 - see above … this may have a bit to do with the problem
Have only really been looking at questions asked on stack overflow and the likes but here are a couple that may be of interest @arcturus2. They present some possible options for approaches we could take for adding pagination to table view: https://stackoverflow.com/questions/15349185/javafx-tableview-paginator https://gist.github.com/timbuethe/7becdc4556225e7c5b7b