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

Performance Improvements #408

Merged
merged 35 commits into from
Oct 21, 2024
Merged

Performance Improvements #408

merged 35 commits into from
Oct 21, 2024

Conversation

NateLanza
Copy link
Contributor

@NateLanza NateLanza commented Oct 15, 2024

Does this PR close any open issues?

Closes #334

Give a longer description of what this PR addresses and why it's needed

Improves performance across a variety of actions by reducing unnecessary re-renders. Includes:

  • Adding WhyDidYouRender plugin to dev mode for debugging re-renders
  • Wrapping the VegaLite element in the attribute density plots with a memoized component that only depends on strictly necessary props
  • Preventing unnecessary re-renders during sorting, aggregation, hovering, selection, and visible attribute changes
  • Using Recoil state in App to memoize rows
  • Replacing VERY costly getValuesFromRow function in AttributeBar with a memoized Recoil selector
  • Memoizing props fed to VegaLite component in element view sidebar
  • Not rendering ElementSidebar component unless it is open

Provide pictures/videos of the behavior before and after these changes (optional)

No visible changes to behavior other than speedup

Have you added or updated relevant tests?

  • Yes
  • No changes are needed

Have you added or updated relevant documentation?

  • Yes
  • No changes are needed

@NateLanza NateLanza self-assigned this Oct 15, 2024
Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for upset2 ready!

Name Link
🔨 Latest commit 50fc39e
🔍 Latest deploy log https://app.netlify.com/sites/upset2/deploys/6716945b67974300087a34d8
😎 Deploy Preview https://deploy-preview-408--upset2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/app/src/components/Body.tsx Outdated Show resolved Hide resolved
packages/app/src/index.tsx Outdated Show resolved Hide resolved
packages/upset/src/components/Root.tsx Show resolved Hide resolved
Copy link
Member

@JakeWags JakeWags left a comment

Choose a reason for hiding this comment

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

Looks great. A few changes for clarity, but not blocks to merging.

@NateLanza NateLanza merged commit 968219f into main Oct 21, 2024
7 checks passed
@NateLanza NateLanza deleted the 334-performance branch October 21, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance: highlights are slow in large datasets
3 participants