Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Performance issues #24

Open
ajb opened this issue Feb 21, 2015 · 5 comments
Open

Performance issues #24

ajb opened this issue Feb 21, 2015 · 5 comments

Comments

@ajb
Copy link

ajb commented Feb 21, 2015

The site is pretty un-performant, which seems to be due to some aspect of d3:

img

Just flagging this as a potential issue, especially as data continues to be added.

@johnpaulfarmer
Copy link
Collaborator

Thanks, Adam! Recommendations?

@ajb
Copy link
Author

ajb commented Feb 22, 2015

Unfortunately I've never really used D3. Maybe someone with some experience
there can chime in.

On Sun, Feb 22, 2015 at 11:04 AM, John Paul Farmer <[email protected]

wrote:

Thanks, Adam! Recommendations?


Reply to this email directly or view it on GitHub
#24 (comment)
.

Adam Becker
(951) 9-BECKER
@AdamJacobBecker

@johnpaulfarmer
Copy link
Collaborator

@tsiege @luisdaniel @rypan Any suggestions for how to improve D3 performance?

@luisdaniel
Copy link

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".

@kenchandev
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants