[IMP] BottomBarStatistics: faster computation of stats
Description:
[IMP] BottomBarStatistics: Memoize cell filtering To compute the statistics, we filter out the cells by type for each function. However, there are only 2 different filters to apply for the 6 different functions.
This revision introduces a memoization of that filter to compute it 3 times less.
[IMP] BottomBarStatistics: Lazify statistic evaluation Each time we fetch the statistics, we compute all 6 of them even though we only need one of them to display (We need all of them when the statistics selection menu is open).
This revision lazifies the computation of those statistics.
[IMP] BottomBarStatistics: limit redundant getter calls While we iterate over the cells to check their visibility, we keep checking the visibility of cells over which we already know that their col (or row) is hidden.
This revision adds a memoization of limit the calls to the different getters involved by memoizing them.
Overall Benchmark
On a demo sheet with makeLargeDataset of 260k cells
_computeStatisticFnResult:
Firefox: 200ms to 80ms
Chrome: 130ms to 42ms
Task: : 3827324
review checklist
- [ ] feature is organized in plugin, or UI components
- [ ] support of duplicate sheet (deep copy)
- [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
- [ ] in model/UI: ranges are strings (to show the user)
- [ ] undo-able commands (uses this.history.update)
- [ ] multiuser-able commands (has inverse commands and transformations where needed)
- [ ] new/updated/removed commands are documented
- [ ] exportable in excel
- [ ] translations (_t("qmsdf %s", abc))
- [ ] unit tested
- [ ] clean commented code
- [ ] track breaking changes
- [ ] doc is rebuild (npm run doc)
- [ ] status is correct in Odoo