kgabryje opened a new pull request #16545: URL: https://github.com/apache/superset/pull/16545
### SUMMARY Due to incorrect passing of props and setting state of FiltersBadge, we were rerendering the component multiple times. It's very expensive, as FiltersBadge calls `selectIndicatorsForChart` and `selectNativeIndicatorsForChart` functions, which traverse dashboard layout tree. Rerendering filters badge for every chart resulted in thousands of unnecessary traverses of dashboard layout tree, causing the performance to take a hit. This PR introduces caching and memoization for FiltersBadge, which reduces the amount of redundant rerenders. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: https://user-images.githubusercontent.com/15073128/131681210-7fd4ff10-fd9d-49c3-b467-2448eb99f7c8.mov After: https://user-images.githubusercontent.com/15073128/131681806-7f1da2f8-5ae5-416b-a3c3-6879ce4e4f7f.mov ### TESTING INSTRUCTIONS Everything should work as before ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API CC @junlincc -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
