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

fix(sqllab): rendering performance regression #23653

Merged

Conversation

justinpark
Copy link
Member

@justinpark justinpark commented Apr 11, 2023

SUMMARY

When a schema contains a humorous table list, rendering cost of SqlEditorLeftBar is heavy since it requires to iterate millions items. To avoid the lag of using sql editor, we should avoid the LeftBar rendering while typing.
This commit removes the unnecessary immediate QUERY_EDITOR_SET_SQL action (and it's already covered by the next line setQueryEditorAndSaveSqlWithDebounce function) while typing which triggers the re-rendering of SqlEditorLeftBar.

(Still need refactoring SqlEditor to avoid observing all sqlEditor updates. I will follow up additional work once redux-toolkit (+r eact-query) migration completed)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After (no lag while typing):

after--rendering-perf.mov

Before (typing at same speed):

before--rendering-perf.mov

TESTING INSTRUCTIONS

open sqllab with a list of > 100,000 tables
typing in the sql editor

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

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

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #23653 (af6ebaf) into master (825006d) will increase coverage by 0.00%.
The diff coverage is n/a.

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

@@           Coverage Diff           @@
##           master   #23653   +/-   ##
=======================================
  Coverage   67.93%   67.94%           
=======================================
  Files        1918     1918           
  Lines       73891    73890    -1     
  Branches     8058     8058           
=======================================
+ Hits        50199    50204    +5     
+ Misses      21633    21625    -8     
- Partials     2059     2061    +2     
Flag Coverage Δ
javascript 53.90% <ø> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...frontend/src/SqlLab/components/SqlEditor/index.jsx 58.60% <ø> (+1.91%) ⬆️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@justinpark justinpark merged commit a5b6ccc into apache:master Apr 11, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request Apr 11, 2023
justinpark added a commit to justinpark/superset that referenced this pull request Apr 12, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request Apr 17, 2023
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Apr 26, 2023
sebastianliebscher pushed a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
sebastianliebscher pushed a commit to sebastianliebscher/superset that referenced this pull request Apr 28, 2023
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 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/M 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants