You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mounting a lot of widgets, the time to mount can add up quite a bit. This issue highlights a couple ways to deal with it. These PRs are ordered in the ordering they should end up in master.
Times are for an extreme app which mounts hundreds of widgets using DynamicWidgets.
The applied changed in 🟢 are available in InstantSearch.js 4.64.1, React InstantSearch 7.5.3, Vue InstantSearch 4.13.5
swap clearRefinements for individual refinement clearing methods which are more efficient 🟢
Don't recompute search parameters for every widget 🔴
privateHelperSetState function needs to loop through every already added widget, and this is called once per addWidgets. In react there's one addWidgets for every widget, instead of being able to call addWidgets once for all widgets at once
impact: 120ms -> ~70ms(?) (only an estimate, this was completely removing the code completely)
For the moment this is too much code to change to be able to measure, but we have a decent amount of impact cleaning up the impact of a widget no longer being mounted in getWidgetSearchParameters and getWidgetUiState. This would be more efficient if we left the empty values in place instead of looping and checking if every value is empty.
This isn't straightforward to change, as UiState is passed to routing for example where we need to be sure empty values are removed (they aren't today), as well as for inheriting parameters with multi-index, where an empty values implies a child index takes preference over a parent index, even if it has no refinements.
The text was updated successfully, but these errors were encountered:
Hi @redox, Haroen is off so I'll answer in his place. Today's release of instantsearch.js@4.64.1, react-instantsearch@7.5.3 and vue-instantsearch@4.13.5 include the PRs mentioned in this issue.
When mounting a lot of widgets, the time to mount can add up quite a bit. This issue highlights a couple ways to deal with it. These PRs are ordered in the ordering they should end up in
master
.Times are for an extreme app which mounts hundreds of widgets using DynamicWidgets.
The applied changed in 🟢 are available in InstantSearch.js 4.64.1, React InstantSearch 7.5.3, Vue InstantSearch 4.13.5
swap clearRefinements for individual refinement clearing methods which are more efficient 🟢
Fix sort of facet values in requestBuilder 🟢
avoid a copy of parameters to set in
setQueryParameters
andnew SearchParameters
🟢Don't recompute search parameters for every widget 🔴
instantsearch/packages/instantsearch.js/src/widgets/index/index.ts
Lines 326 to 333 in 2258d89
Don't clean up "unused" UiState and parameters 🔴
The text was updated successfully, but these errors were encountered: