Optimization sub-task for #9511 and #9512 to improve collection.Base calcValueBands for large datasets.
Changes:
- Partial Recalculation:
calcValueBands now supports an optional startIndex. When passed (e.g. from splice), the algorithm retrieves the banding state from the preceding item and only recalculates for the affected subset of the array.
- Sparse Array Support: Added a check for missing items (
items[i]) within the calculation loop to prevent crashes when dealing with sparse arrays or buffered data loading.
- Map Persistence: The
valueBandsMap is no longer fully cleared unless a full recalculation (startIndex === 0) is requested, reducing GC churn.
Verified with existing test suite test/playwright/unit/data/StoreValueBandingCount.spec.mjs.
Optimization sub-task for #9511 and #9512 to improve
collection.BasecalcValueBandsfor large datasets.Changes:
calcValueBandsnow supports an optionalstartIndex. When passed (e.g. fromsplice), the algorithm retrieves the banding state from the preceding item and only recalculates for the affected subset of the array.items[i]) within the calculation loop to prevent crashes when dealing with sparse arrays or buffered data loading.valueBandsMapis no longer fully cleared unless a full recalculation (startIndex === 0) is requested, reducing GC churn.Verified with existing test suite
test/playwright/unit/data/StoreValueBandingCount.spec.mjs.