perf: Improve dashboard performance by decreasing rerenders#30958
perf: Improve dashboard performance by decreasing rerenders#30958kgabryje wants to merge 24 commits intoapache:masterfrom
Conversation
|
These PRs from Kamil always make me soo happy! ❤️ |
|
/testenv up |
villebro
left a comment
There was a problem hiding this comment.
I did my best to find anything to comment or even nit about in this PR, but this looks really solid. I will have to resort to testing to see there's anything that looks out of the ordinary. Will approve once I'm done with the testing rounds..
|
@villebro Ephemeral environment spinning up at http://52.38.80.189:8080. Credentials are |
There was a problem hiding this comment.
Nice improvement. Nit: should this be named nativeFilters outside of the context of this PR, I don't think "optimized" make sense.
c7aa867 to
c8d5eca
Compare
|
/testenv up |
|
@villebro Ephemeral environment spinning up at http://35.91.239.242:8080. Credentials are |
|
@villebro unfortunately the ephemeral environments have been broken for some time now 🙁 |
|
Neat AI summary provided by @rusackas 🙂 Key changes include:
The main potential risk areas to watch:
Recommend thorough testing of: |
555df32 to
26a1163
Compare
acd0935 to
999faa9
Compare
SUMMARY
SUPERSEDED BY PRs: #31240, #31241, #31242, #31243, #31244.
This PR is not to be merged - aggregates 5 smaller PRs to be referenced as total performance improvement.
Due to many inefficient redux selectors and other factors causing numerous rerenders, large dashboards were running very slow.
This PR refactors many components related to Dashboard and native filters - some components are rewritten to functional to utilize React's memoization, Redux selectors optimized to select smaller objects that change less frequently, optimized frequently called functions.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
The tests were conducted on a large dashboard - 300+ charts, 40+ filters. Test steps: reload the page, let the 1st tab load, switch to a different tab, let everything load.
Tested on my M2 Pro Macbook - since it's likely that an average Superset user works on a slower computer, I also run the tests with 4x and 20x CPU throttling.
Testing tool - chrome dev tools, performance tab
No throttling
Before - total scripting time 2.73s (screenshot 1), each chart holder blocks the main thread for ~70ms
After - total scripting time 1.48s (screenshot 2), each chart holder blocks the main thread for ~5ms
4x throttling
Before - total scripting time 11.93s (screenshot 3), each chart holder blocks the main thread for ~300ms
After - total scripting time 6.23s (screenshot 4), each chart holder blocks the main thread for ~20ms
20x throttling
Before - total scripting time 82s (screenshot 5), each chart holder blocks the main thread for ~2s
After - total scripting time 32s (screenshot 6), each chart holder blocks the main thread for ~100ms
SCREENSHOTS BEFORE:
SCREENSHOTS AFTER:
TESTING INSTRUCTIONS
No functional changes - all dashboard functionalities should work like before.
Recommend thorough testing of:
ADDITIONAL INFORMATION