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): Table options rendering regression #24142

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

There's a rendering perf regression from #22084

When SelectAll feature introduced by #22084
, Select component became rendering options by jsx only. This makes the performance degraded for the large size options.

options | Select options. Will get better perf than jsx definition
-- | --

This commit recovers the way to use options prop as before (including SelectAll condition)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After: (~100ms)
Screenshot 2023-05-19 at 11 22 50 AM

Before: (>5000ms)
Screenshot 2023-05-19 at 11 18 14 AM

TESTING INSTRUCTIONS

select a large size table option schema
click the table dropdown and then measure the delay

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

@@ -440,6 +441,11 @@ const Select = forwardRef(
onChange?.(newValues, newOptions);
};

const shouldUseChildrenOptions = useMemo(
() => !selectAllEnabled || hasCustomLabels(options),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
() => !selectAllEnabled || hasCustomLabels(options),
() => selectAllEnabled || hasCustomLabels(options),

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 May 19, 2023

Codecov Report

Merging #24142 (586a31d) into master (5159861) will decrease coverage by 0.02%.
The diff coverage is 72.25%.

❗ Current head 586a31d differs from pull request most recent head 2bba1f9. Consider uploading reports for the commit 2bba1f9 to get more accurate results

@@            Coverage Diff             @@
##           master   #24142      +/-   ##
==========================================
- Coverage   68.28%   68.26%   -0.02%     
==========================================
  Files        1952     1952              
  Lines       75432    75353      -79     
  Branches     8191     8207      +16     
==========================================
- Hits        51505    51437      -68     
+ Misses      21823    21810      -13     
- Partials     2104     2106       +2     
Flag Coverage Δ
javascript 54.69% <47.27%> (-0.02%) ⬇️

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% <ø> (ø)
...end/src/features/databases/DatabaseModal/styles.ts 77.66% <ø> (ø)
superset-frontend/src/pages/DatabaseList/index.tsx 66.03% <0.00%> (ø)
superset/commands/importers/v1/assets.py 88.09% <0.00%> (+2.04%) ⬆️
superset/config.py 91.97% <ø> (-0.05%) ⬇️
superset/datasets/commands/importers/v1/utils.py 79.41% <0.00%> (+0.77%) ⬆️
superset/db_engine_specs/databricks.py 70.92% <0.00%> (+0.49%) ⬆️
superset/db_engine_specs/snowflake.py 67.64% <0.00%> (+0.39%) ⬆️
superset/migrations/env.py 0.00% <0.00%> (ø)
superset/models/helpers.py 69.90% <0.00%> (+0.07%) ⬆️
... and 74 more

... and 3 files with indirect coverage changes

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

@justinpark justinpark merged commit 6a44e0d into apache:master May 22, 2023
justinpark added a commit to airbnb/superset-fork that referenced this pull request May 23, 2023
john-bodley pushed a commit to airbnb/superset-fork that referenced this pull request Jun 21, 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 8, 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 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants