-
Notifications
You must be signed in to change notification settings - Fork 0
Performance issues #24
Comments
Thanks, Adam! Recommendations? |
Unfortunately I've never really used D3. Maybe someone with some experience On Sun, Feb 22, 2015 at 11:04 AM, John Paul Farmer <[email protected]
Adam Becker |
@tsiege @luisdaniel @rypan Any suggestions for how to improve D3 performance? |
It's the force-directed graph. D3 takes all the nodes and draws them on the canvas randomly, then it has a "force" function which rearranges them on the canvas. What Ken has done is placed that "force" function inside of a while loop, which only exits until all nodes have been positioned (but not drawn yet), once it exits that while loop, then the nodes are drawn on the canvas. Thanks to the while loop, the graph is drawn way faster. However, D3 still has to go through this process. I'm not sure how to speed this up even more. Ken's solution is the best I've seen so far. I've heard D3 doesn't scale so well with nodes after 500 or so. So perhaps once you get there and start seeing more performance issues, it might be time to figure some other solution. Like loading some of the nodes, instead of all. What you can also do, and I recommend, is add a spinny "loading" wheel while the graph displays. That way the user expects something is loading. The graph loads in less than two seconds, so the user will be "whoa, that was fast, I guess". |
I definitely agree that generating the initial DOM structure for the force-directed graph visualization can be a bit "hefty" given a large amount of data. I have looked into this issue, and I have decided that rendering the visualization on the server-side via the d3 and jsdom npm modules would improve the performance of the web application. I will be working on this shortly after other issues have been resolved. |
The site is pretty un-performant, which seems to be due to some aspect of d3:
Just flagging this as a potential issue, especially as data continues to be added.
The text was updated successfully, but these errors were encountered: