Skip to content
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

Tips for improving efficiency #19

Open
robclouth opened this issue Aug 17, 2016 · 2 comments
Open

Tips for improving efficiency #19

robclouth opened this issue Aug 17, 2016 · 2 comments

Comments

@robclouth
Copy link

I'm making a patching environment for real-time graphics for mobile, and I want the graph to have the autolayout so that it's always clean and consistent. This means that every time you add a new node or edges, it should apply the layout algorithm. However, when the graph gets beyond a certain size the layouting gets slower and slower until doing it every change is unrealistic.

Are there ways of only laying out certain parts? Just the parts that have changed instead of calculating the layout of the whole graph even if most of it doesn't change.

Which of the layout options is the most efficient?

How big a graph would you expect to have calculation time of less than half a second?

Thanks!

@le-cds
Copy link
Member

le-cds commented Aug 18, 2016

I'm not exactly the JavaScript person in the project, so I'll answer the question from a non-JavaScript point of view.

Are there ways of only laying out certain parts?

No, we currently don't have any layout algorithms that support this kind of thing.

Which of the layout options is the most efficient?

The following settings should improve the algorithm's performance:

de.cau.cs.kieler.klay.layered.nodeLayering: LONGEST_PATH
de.cau.cs.kieler.klay.layered.greedySwitch: OFF

You can also try the following setting, but I'm not sure if that will actually improve performance since the default setting should already be quite fast:

de.cau.cs.kieler.klay.layered.nodePlacement: LINEAR_SEGMENTS

How big a graph would you expect to have calculation time of less than half a second?

That's a bit hard to answer. In general, layout performance not only depends on the number of nodes, but also on the number of edges and the graph's general structure. Having said that, I would expect layout to take less than half a second for up to a couple of hundred nodes with a reasonable number of connections. On desktop computers, that is. I don't have any point of reference for mobile devices. See ticket #15 for another discussion on algorithm performance.

@forresto
Copy link

@robclouth Have you tried running klay in a worker? https://github.com/OpenKieler/klayjs#web-worker

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

No branches or pull requests

3 participants