Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Optimise loading of assets #13

Open
kittsville opened this issue Dec 23, 2016 · 2 comments
Open

Optimise loading of assets #13

kittsville opened this issue Dec 23, 2016 · 2 comments

Comments

@kittsville
Copy link
Owner

Currently several of the JavaScript assets make direct reference in top level code to dependencies in other files. For example Cytoscape requires jQuery already be loaded. This creates an annoying dependency chain that greatly slows page loads. The JS assets need wrapping in container functions so they can be loaded asynchronously then activated in order of dependency.

@kittsville
Copy link
Owner Author

Given how slow the front-end is I think this takes priority over any other front-end issues.

@kittsville
Copy link
Owner Author

Turns out modern browsers load the scripts async anyway and then just execute them synchronously. Main thing slowing down page loads is that:

  • Cytoscape is massive (104KB gzipped)
  • Graph JSON is loaded after the rest of scripts
  • Graph JSON isn't cached
  • It takes time to render 581 nodes/edges

Wr.t. solutions:

  • Cytoscape can't exactly be reduced in size (short of building my own slimmed down version)
  • Could use FileReader API to pre-load the JSON
  • Caching was fixed in f1b391f
  • Could potentially avoid freezing by rendering bit by bit and displaying the graph as soon as the first few nodes have been rendered?

@kittsville kittsville removed their assignment Dec 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant