Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Call useGridColumnPinning before useGridColumns #3676

Merged
merged 1 commit into from Jan 21, 2022

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Jan 20, 2022

Each hook using GridPreProcessingGroup.hydrateColumns and called after useGridColumns causes a full additional pre-processing on mount because the columns need to be pre-processed before and after the 1st call of the feature hook.
Whereas if the feature hook is before, the pre-processing will only run once when useGridColumns is called.

The same applies to other pre-processings but this one is especially heavy when we have a lot of columns and has a lot of hooks hooked to it, so we could quickly run 5 or more useless pre-processings if we don't take care.

To more we move toward event listeners and pre-processors, the more useGridRows and useGridColumns should be late in the feature hook call order.

Same things as described here #3387 (comment)

@flaviendelangle flaviendelangle self-assigned this Jan 20, 2022
@flaviendelangle flaviendelangle changed the title [DataGridPro] Call useGridColumnPinning before useGridColumns [core] Call useGridColumnPinning before useGridColumns Jan 20, 2022
@flaviendelangle flaviendelangle added the core Infrastructure work going on behind the scenes label Jan 20, 2022
@flaviendelangle flaviendelangle changed the title [core] Call useGridColumnPinning before useGridColumns [core] Call useGridColumnPinning before useGridColumns Jan 20, 2022
@mui-bot
Copy link

mui-bot commented Jan 20, 2022

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 190.6 297.7 232 243.12 43.14
Sort 100k rows ms 385 656.9 611.5 579.42 99.42
Select 100k rows ms 198.8 277.2 242.4 240.08 28.152
Deselect 100k rows ms 125.4 261.1 202.9 194.32 45.117

Generated by 🚫 dangerJS against 58efc03

@flaviendelangle flaviendelangle merged commit dcaa6d8 into mui:master Jan 21, 2022
@flaviendelangle flaviendelangle deleted the pinning-hook-order branch January 21, 2022 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants