question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table View causing application lag

See original GitHub issue

Prerequisites

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

  1. Create a new graph
  2. Experimental ->Build Graph -> Sphere Graph
  3. Set to 50k transactions
  4. Create a new empty graph (now you should have 2 graphs)
  5. Open the table view (and notice the memory jump up)
  6. 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:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
formalhaut69commented, May 8, 2020

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

image

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

0reactions
antares1470commented, Jun 5, 2020

I think it is worth exploring and perhaps those techniques could be added to views like the conversation view. Can you provide links to articles you found good here?

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

TableView gets laggy with data - ios - Stack Overflow
A table view gets slower (responses slower to scrolling, tapping) after ... So after the user logs in, the app downloads 10 "WorldMessages"....
Read more >
Laggy TableView scrolling | Apple Developer Forums
In my tableview I have a few custom cells. When I scroll in the tableview it lags in the same spot but only...
Read more >
Fixing UITableView Lag - uShip
Fixing UITableView lag by populating UITableViewCells asynchronously. ... problem of a slow model leading to laggy scrolling performance.
Read more >
Why is tableView lagging when scrolled fast ... - Reddit
If the rows have image(s), the problem is highly likely caused by how you cache/display images. Or,. If you're fetching images remotely for...
Read more >
iOS Performance Tricks To Make Your App Feel More ...
A slow and unresponsive app might make users give up on using your app ... By using a queue to store cells, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found