flow-components
flow-components copied to clipboard
fix: Improve performance of SpreadsheetFilterTable
Description
SpreadsheetFilterTable performs very slowly when changing filter state, especially noticeable on large datasets, due to the original implementation calling spreadsheet.setRowHidden(boolean) on every single line of the dataset, and spreadsheet.setRowHidden recalculating styles eagerly every time, including a full remeasurement of every cell in the document, reloading of embedded images and recreation of style data.
Originally attempting to change the filtered columns in autofilter_with_large_table.xlsx took several minutes to complete on the server, allowing for potential denial of service. After optimization, the operation takes around 50 milliseconds.
Adds a function that allows disabling eager style recalculation for setRowHidden and setRowHeight for user-side batch operations and potential future optimization.
Fixes #7211
Type of change
- [x] Bugfix
- [ ] Feature
Checklist
- [x] I have read the contribution guide: https://vaadin.com/docs/latest/contributing/overview
- [x] I have added a description following the guideline.
- [x] The issue is created in the corresponding repository and I have referenced it.
- [x] I have added tests to ensure my change is effective and works as intended.
- [x] New and existing tests are passing locally with my change.
- [x] I have performed self-review and corrected misspellings.
Removed unit test. Unit test did not function as intended. Failure case was not caught correctly, resulting in runaway execution. Large table could not be loaded on test VM due to lack of available memory (!). Manual testing suggested.
Quality Gate passed
Issues
2 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Closing in favor of https://github.com/vaadin/flow-components/pull/7273