-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Introducing web workers #233
base: master
Are you sure you want to change the base?
Conversation
I think this is a cool experiment but I actually think a lot of the perf improvements could be improved in the main thread first which I did in #232. I can't remember the line of code but essentially I just reduced the large amount of recalc. |
@jonathanKingston
Case 1: Page Load
Case 2: Add new nodes (
Case 3: Add new nodes (
Next Steps:
|
This is an initial attempt to improve the graph's performance for large no. of nodes.
Issue #232
The idea in this PR is to off-load the heavy force layout computations to the web worker. This improves performance during page load.
I am also experimenting on passing the logic to web workers during the drag events. This part is still work in progress.
Here is the rough idea that I try to achieve:
In the present situation, when we drag, the force layout restarts the simulation. When there are large no. of nodes, the graph takes a lot of time to achieve equilibrium, thereby dropping the frame rates. Restarting the simulation is necessary, to compute the updated coordinates and give the soft transition, else the drag effect doesn't appear smooth.
Using web workers, I try to keep the dragged coordinates in the main thread, invoke the web worker during
dragEnd
. The web worker computes the updated coordinates and waits until the graph attains equilibrium. I need to figure a way to get the updated coordinates and achieve smooth animations.cc @jonathanKingston @biancadanforth