cytoscape / cytoscape-explore

Network visualization webapp.
MIT License
13 stars 4 forks source link

Use a single CouchDB document to hold a network's data #129

Closed maxkfranz closed 2 years ago

maxkfranz commented 2 years ago

General information

Associated issues:

Checklist

Author:

Reviewers:

Notes

Details re. (3), for those interested:

This is why the stuttering is there. The network analyser does a lot of calls to getCount() and that's really slow (over 1s of lockup). It's a lot of O(n) network filter (cy.filter()) queries, and it probably adds up to at least O(n^2) in aggregate.

getCount-slow

By caching getCount(), it's a lot faster (< 20 ms). It caches element sets, which is a bit more expensive than it could be (ints). However, it's robust to unbalanced add/remove calls etc. @mikekucera, I'm sure you could optimise this more than I did here, though this seemed like enough for now.

Screen Shot 2022-01-31 at 13 13 42