Swirrl / ook

Structural search engine
https://search-prototype.gss-data.org.uk/
Eclipse Public License 1.0
6 stars 0 forks source link

Select performance #66

Closed kiramclean closed 3 years ago

kiramclean commented 3 years ago

This PR fixes some front-end performance issues. Selecting all children for e.g. the ONS regions codelist now takes ~100ms from ~500ms. Still not ideal, but it's just about at the limit of what "feels" instantaneous, so good enough for now.

I had naively assumed subscriptions were expensive (and intelligent about incremental updates) and rendering was cheap from some prior experience with other frameworks, but with re-frame it's basically the opposite.. subscriptions are cheap and rendering is expensive, so the main improvement in this PR is subscribing at the last minute to the most granular piece of app state necessary to render a given piece of the UI. It also has a couple of changes to minimize the amount of stuff we store in the app state in the first place.

There is also some shuffling files around to organize views/events by component (instead of siloed by function, with e.g. all events together etc.)