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: Memoize the common_bootstrap_payload #21018

Merged
merged 1 commit into from
Aug 16, 2022

Conversation

bkyryliuk
Copy link
Member

@bkyryliuk bkyryliuk commented Aug 8, 2022

SUMMARY

Memoize the common_bootstrap_payload. The function includes the config settings and the feature flags, those tend to be changed in frequently, this PR adds caching layer with 1 minute TTL. In our staging deployment it yields 10x speedup e.g. 22 ms down from ~250 ms

BEFORE

Screen Shot 2022-08-05 at 10 17 57 AM

AFTER

image

TESTING INSTRUCTIONS

[x] Dropbox staging

@bkyryliuk bkyryliuk marked this pull request as draft August 8, 2022 21:46
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Aug 8, 2022
@bkyryliuk bkyryliuk force-pushed the bogdan/memoize_boostrap_common branch from a9b2596 to 6a426cd Compare August 8, 2022 22:44
@bkyryliuk bkyryliuk marked this pull request as ready for review August 8, 2022 22:44
@bkyryliuk bkyryliuk marked this pull request as draft August 8, 2022 22:44
@bkyryliuk bkyryliuk force-pushed the bogdan/memoize_boostrap_common branch 2 times, most recently from 3db56e6 to 1e31838 Compare August 8, 2022 23:23
@pull-request-size pull-request-size bot added size/XS and removed size/S labels Aug 8, 2022
@bkyryliuk bkyryliuk marked this pull request as ready for review August 8, 2022 23:23
@bkyryliuk bkyryliuk marked this pull request as draft August 8, 2022 23:23
@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #21018 (8e3b071) into master (eb5369f) will decrease coverage by 0.20%.
The diff coverage is 50.00%.

❗ Current head 8e3b071 differs from pull request most recent head d62edd4. Consider uploading reports for the commit d62edd4 to get more accurate results

@@            Coverage Diff             @@
##           master   #21018      +/-   ##
==========================================
- Coverage   66.38%   66.18%   -0.21%     
==========================================
  Files        1767     1767              
  Lines       67232    67350     +118     
  Branches     7138     7144       +6     
==========================================
- Hits        44633    44574      -59     
- Misses      20773    20948     +175     
- Partials     1826     1828       +2     
Flag Coverage Δ
hive ?
mysql 80.95% <49.01%> (-0.08%) ⬇️
postgres 81.01% <49.01%> (-0.09%) ⬇️
presto ?
python 81.12% <49.01%> (-0.46%) ⬇️
sqlite 79.61% <49.01%> (-0.07%) ⬇️
unit ?

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

Impacted Files Coverage Δ
...set-ui-core/src/ui-overrides/ExtensionsRegistry.ts 100.00% <ø> (ø)
...frontend/src/SqlLab/components/SaveQuery/index.tsx 74.35% <ø> (ø)
...ntend/src/explore/components/ExploreChartPanel.jsx 67.60% <0.00%> (-1.41%) ⬇️
...ols/MetricControl/AdhocMetricEditPopover/index.jsx 75.53% <ø> (ø)
...et-frontend/src/explore/reducers/exploreReducer.js 38.70% <0.00%> (-1.30%) ⬇️
superset-frontend/src/utils/datasourceUtils.js 100.00% <ø> (ø)
...s/CRUD/data/database/DatabaseModal/ModalHeader.tsx 66.66% <ø> (ø)
.../src/views/CRUD/data/dataset/DatasetPage/index.tsx 0.00% <0.00%> (ø)
superset/models/helpers.py 39.40% <6.66%> (-1.38%) ⬇️
...c/views/CRUD/data/database/DatabaseModal/index.tsx 31.52% <12.50%> (-0.23%) ⬇️
... and 32 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@bkyryliuk bkyryliuk force-pushed the bogdan/memoize_boostrap_common branch from 1e31838 to d14ad97 Compare August 8, 2022 23:33
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Aug 8, 2022
@bkyryliuk bkyryliuk marked this pull request as ready for review August 8, 2022 23:33
@bkyryliuk bkyryliuk force-pushed the bogdan/memoize_boostrap_common branch from d14ad97 to d62edd4 Compare August 9, 2022 00:08
@bkyryliuk bkyryliuk requested review from betodealmeida, etr2460 and a team August 9, 2022 17:46
@bkyryliuk bkyryliuk changed the title perf: Memoize the common_bootstrap_payload [WIP] perf: Memoize the common_bootstrap_payload Aug 9, 2022
Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

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

LGTM!

@bkyryliuk bkyryliuk merged commit 495a205 into apache:master Aug 16, 2022
@bkyryliuk bkyryliuk deleted the bogdan/memoize_boostrap_common branch August 16, 2022 15:27
bkyryliuk added a commit that referenced this pull request Sep 13, 2022
…1018) (#21439)

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
michael-s-molina pushed a commit that referenced this pull request Sep 14, 2022
michael-s-molina pushed a commit that referenced this pull request Sep 14, 2022
…1018) (#21439)

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
eschutho pushed a commit that referenced this pull request Sep 20, 2022
Try patch

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
(cherry picked from commit 495a205)
eschutho pushed a commit that referenced this pull request Sep 20, 2022
zhaorui2022 pushed a commit to zhaorui2022/superset that referenced this pull request Sep 22, 2022
…ache#21018) (apache#21439)

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
AAfghahi pushed a commit that referenced this pull request Oct 6, 2022
Fahrenheit35 pushed a commit to Fahrenheit35/superset that referenced this pull request Nov 11, 2022
Try patch

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
(cherry picked from commit 495a205)
Fahrenheit35 pushed a commit to Fahrenheit35/superset that referenced this pull request Nov 11, 2022
Fahrenheit35 pushed a commit to Fahrenheit35/superset that referenced this pull request Jul 11, 2023
@mistercrunch mistercrunch added 🍒 1.5.2 🍒 1.5.3 🍒 2.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/S v2.0 🍒 1.5.2 🍒 1.5.3 🍒 2.0.1 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants