Skip to content

fix: dashboard performance - #28609

Merged
eschutho merged 9 commits into
apache:masterfrom
preset-io:fix/dashboard-perf
May 28, 2024
Merged

eschutho merged 9 commits into
apache:masterfrom
preset-io:fix/dashboard-perf

Conversation

@dpgaspar

@dpgaspar dpgaspar commented May 20, 2024 •

Copy link
Copy Markdown
Member

SUMMARY

This PR introduces a substantial performance improvement to the dashboard list page.
We have noticed that json_metadata and position_json can contain huge payloads on dashboards that contain a large amount of charts (hundreds). This can heavily impact performance.

The easier path would be to just remove those columns from list_columns on the backend, but thats a breaking change. Also thumbnail_url uses position_json and json_metadata to compute the MD5 digest. So currently it's not possible to improve the REST API performance itself by default.

it's possible on FAB to just request the columns we want using the columns query parameter, but the SQL selected columns would still use the configures list_columns or list_select_columns. On 4.5.0 I've introduced a new query parameter named select_columns that works exactly like columns but will actually on query the requested columns (without never "escaping" the list_columns set configured on the backend, for security reasons).

Using the example dashboards:

Requesting just the columns we need defined on this PR, avg API response is ~16ms

Using the API by default (backend defined columns), avg API response is ~120ms

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

codecov Bot commented May 20, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.29%. Comparing base (76d897e) to head (f366583).
Report is 1094 commits behind head on master.

Files with missing lines Patch % Lines
...frontend/src/features/dashboards/DashboardCard.tsx 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #28609      +/-   ##
==========================================
+ Coverage   60.48%   70.29%   +9.81%     
==========================================
  Files        1931     1949      +18     
  Lines       76236    77635    +1399     
  Branches     8568     8738     +170     
==========================================
+ Hits        46114    54577    +8463     
+ Misses      28017    20930    -7087     
- Partials     2105     2128      +23     
Flag Coverage Δ
hive 49.07% <ø> (-0.10%) ⬇️
javascript 57.87% <86.66%> (+0.16%) ⬆️
mysql 77.16% <ø> (?)
postgres 77.29% <ø> (?)
presto 53.61% <ø> (-0.19%) ⬇️
python 83.53% <ø> (+20.05%) ⬆️
sqlite 76.74% <ø> (?)
unit 59.01% <ø> (+1.38%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pull-request-size pull-request-size Bot added size/L and removed size/S labels May 21, 2024
@dpgaspar
dpgaspar marked this pull request as ready for review May 21, 2024 10:11
@dosubot dosubot Bot added the dashboard:performance Related to Dashboard performance label May 21, 2024
@dpgaspar
dpgaspar requested a review from eschutho May 21, 2024 10:54
@eschutho
eschutho force-pushed the fix/dashboard-perf branch from 49bcc71 to 452e886 Compare May 22, 2024 00:42
@eschutho
eschutho force-pushed the fix/dashboard-perf branch from 452e886 to 0ebfb38 Compare May 22, 2024 01:11
@eschutho

Copy link
Copy Markdown
Member

/testenv up

@github-actions

Copy link
Copy Markdown
Contributor

@eschutho Ephemeral environment spinning up at http://35.95.35.109:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Comment thread requirements/base.txt
# via flask-appbuilder
apsw==3.42.0.1
# via shillelagh
async-timeout==4.0.3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just noting that this particular pinned dep has been flickering, meaning pip-compile-multi isn't as deterministic as I'd like for it to be, for reasons I don't really understand

@mistercrunch mistercrunch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM overall. It's nice to be able to specify the columns needed for the list view

@eschutho
eschutho merged commit 87110eb into apache:master May 28, 2024
@eschutho
eschutho deleted the fix/dashboard-perf branch May 28, 2024 20:09
@github-actions

Copy link
Copy Markdown
Contributor

Ephemeral environment shutdown and build artifacts deleted.

eschutho added a commit that referenced this pull request Jun 5, 2024
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: Joe Li <[email protected]>
(cherry picked from commit 87110eb)
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: Joe Li <[email protected]>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 4.1.0 First shipped in 4.1.0 labels Nov 27, 2024
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: Joe Li <[email protected]>
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 dashboard:performance Related to Dashboard performance size/L 🚢 4.1.0 First shipped in 4.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants