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.

Sphere Graph / Renderer speed decreased

See original GitHub issue

Prerequisites

Description

Lately I’ve noticed building sphere graphs - or more specifically rendering them has decreased drastically in performance. I feel like I used to be able to make a graph with 10000 vertices without issue. Now it takes what seems like minutes to render anything.

Steps to Reproduce

  1. new graph
  2. build sphere graph use 1000/10000 nodes to see the delays. Compare with other release versions.

Expected behaviour: loads fast

Actual behaviour: loads slow

Reproduces how often: 100%

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

3reactions
Nova-2119commented, Oct 20, 2020

In the branch https://github.com/constellation-app/constellation/tree/performance/838-MultiThreading I have continued this ticket with a focus on multi-threading where possible to improve speed outcomes. Since then I have managed to multi-thread both the NodeLabelBatcher and the ConnectionLabelBatcher which has led to large improvements in rendering speed. The branch is still a work in progress, more work needs to be done to optimise the amount of threads being created and potentially improve upon the current implementation. Attached is an updated copy of the render time comparison with the latest rendering times in both the case where just NodeLabelBatcher is multi-threaded and both NodeLabelBatcher and ConnectionLabelBather are multi-threaded. Render time comparison.txt

3reactions
Nova-2119commented, Oct 2, 2020

So it turns out the reason it is slower to open a graph multiple times is actually not due to opening a second graph but due having just closed a graph. Closing a graph calls the GraphRenderable.dispose() method which calls GLVisualProcessor.rebuild() which triggers a fullRefresh of the graph. This means that when you close the graph it actually rebuilds it in the background and never displays it to the screen. The slow down observed is actually it waiting for the refresh from the close to finish prior to performing a new refresh! This is why the times were roughly twice as slow and more variable, it’s doing the same thing twice and the amount of time between me closing the last graph and opening the new one explains the variability 😃

Some light digging showed me that reshape is called whenever a refresh should be performed, so I have moved the call to rebuild out of dispose and into that method. This has removed the slowdown affect and as far as I can tell everything behaves as it should.

I am doing some further investigating so that I can be sure that reshape is the correct method to call rebuild in, display() and init() are alternatives that might work. I need to become familiar with exactly when each is and isn’t called and how that correlates to when a refresh is and isn’t required. From names alone display feels like it should make more sense, but there’s more digging to be done to understand exactly what that does.

Render time comparison.txt

Read more comments on GitHub >

github_iconTop Results From Across the Web

Performance Optimization when rendering more than 12k ...
I am trying to render 5k nodes and 7k links using the 3d force graph. The performance significantly drops after 7k elements are...
Read more >
Chart rendering too slow - reporting services - Stack Overflow
The issue I am facing is the chart becomes too slow (>10 s of rendering) as soon as I implement the drill down...
Read more >
Large Graph Performance | yFiles for HTML Documentation
Large Graph Performance. This section covers techniques for displaying and editing very large graphs with thousands of elements with yFiles for HTML.
Read more >
Spherical Layout and Rendering Methods for Immersive ...
In this work, we explore a new, immersive approach for graph visualization, designed specifi- cally for virtual reality environments. 1 INTRODUCTION.
Read more >
Slow rendering - Android Developers
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user will perceive stuttering in...
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