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

perf(plugin-chart-table): Add memoization to avoid rerenders #19976

Merged
merged 2 commits into from
May 13, 2022

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented May 6, 2022

SUMMARY

Due to some missing memoization, table chart was rerendering even on actions unrelated to table itself, like switching tab from Data to Customize or adding a search box to the chart, causing those actions to be laggy. That was especially visible in large tables (with thousands of visible cells). This PR fixes that behaviour.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-05-06.at.12.37.12.mov

After:

Screen.Recording.2022-05-06.at.12.35.22.mov

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@codecov
Copy link

codecov bot commented May 6, 2022

Codecov Report

Merging #19976 (78f30eb) into master (ca9766c) will decrease coverage by 0.05%.
The diff coverage is 70.00%.

❗ Current head 78f30eb differs from pull request most recent head 187f95d. Consider uploading reports for the commit 187f95d to get more accurate results

@@            Coverage Diff             @@
##           master   #19976      +/-   ##
==========================================
- Coverage   66.35%   66.29%   -0.06%     
==========================================
  Files        1712     1713       +1     
  Lines       64080    63966     -114     
  Branches     6744     6731      -13     
==========================================
- Hits        42520    42408     -112     
+ Misses      19847    19846       -1     
+ Partials     1713     1712       -1     
Flag Coverage Δ
javascript 51.28% <70.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ins/plugin-chart-table/src/DataTable/DataTable.tsx 38.54% <0.00%> (ø)
...tend/plugins/plugin-chart-table/src/TableChart.tsx 39.00% <50.00%> (+0.43%) ⬆️
...d/plugins/plugin-chart-table/src/transformProps.ts 64.44% <50.00%> (+0.80%) ⬆️
...-ui-chart-controls/src/utils/getColorFormatters.ts 100.00% <100.00%> (ø)
...d/packages/superset-ui-core/src/utils/typedMemo.ts 100.00% <100.00%> (ø)
superset/sql_validators/__init__.py 80.00% <0.00%> (-20.00%) ⬇️
...set-frontend/src/components/ReportModal/styles.tsx 87.87% <0.00%> (-12.13%) ⬇️
...rc/explore/components/ExploreChartHeader/index.jsx 43.10% <0.00%> (-10.23%) ⬇️
...mponents/nativeFilters/FilterCard/useTruncation.ts 43.47% <0.00%> (-6.53%) ⬇️
.../components/ExploreAdditionalActionsMenu/index.jsx 57.14% <0.00%> (-6.08%) ⬇️
... and 58 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca9766c...187f95d. Read the comment docs.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgabryje kgabryje merged commit 0f68dee into apache:master May 13, 2022
philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
…19976)

* perf(plugin-chart-table): Add memoization to avoid rerenders

* Fix typing
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 and removed 🚢 2.0.1 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants