Content-Length: 297095 | pFad | https://github.com/aws/graph-explorer/pull/542

35 Fix styling sidebar performance by kmcginnes · Pull Request #542 · aws/graph-explorer · GitHub
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 styling sidebar performance #542

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

kmcginnes
Copy link
Collaborator

@kmcginnes kmcginnes commented Aug 8, 2024

Description

This fixes a gnarly performance issue when the number of node or edge types is large (roughly over 20). The browser would essentially lock up and be nearly unuseable.

The problem was that the effect that watch for the Input value change was being fired way too often, including the initial render, and the state update is very slow.

The fix was to properly debounce the value change and also compare to previous value. This led to another fix in the usePrevious hook where it didn't always have the correct value.

And finally, I did some cleanup in the SingleEdgeStyling and SingleNodeStyling components to lean on Recoil selectors to simplify the logic.

Changelog

I accidentally pushed the changelog update to main directly. Since it is a non-destructive change, I'm just going to leave it there rather than revert it and add it to this PR.

fc0a0e5

Validation

  • Tested changing display name in Input in sidebar
  • Tested changing preferences in customize popup
  • Tested resetting styles in customize popup

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0
    license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

@kmcginnes kmcginnes force-pushed the fix-styling-sidebar-performance branch from 2172983 to 5923852 Compare August 8, 2024 22:46
@kmcginnes kmcginnes marked this pull request as ready for review August 8, 2024 22:49
@kmcginnes kmcginnes requested a review from michaelnchin August 8, 2024 22:50
Copy link
Member

@michaelnchin michaelnchin left a comment

Choose a reason for hiding this comment

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

There are a couple of unit test errors under the usePrevious hooks, be sure to fix/adjust these

@kmcginnes
Copy link
Collaborator Author

There are a couple of unit test errors under the usePrevious hooks, be sure to fix/adjust these

Oof.. You are right. Turns out I ran the checks and tests on the main branch too. LOL.

I'll get them fixed up.

1 similar comment
@kmcginnes
Copy link
Collaborator Author

There are a couple of unit test errors under the usePrevious hooks, be sure to fix/adjust these

Oof.. You are right. Turns out I ran the checks and tests on the main branch too. LOL.

I'll get them fixed up.

@kmcginnes
Copy link
Collaborator Author

Tests fixed

@michaelnchin michaelnchin self-requested a review August 9, 2024 00:25
@kmcginnes kmcginnes merged commit b7be8de into aws:main Aug 9, 2024
1 check passed
@kmcginnes kmcginnes deleted the fix-styling-sidebar-performance branch August 9, 2024 01:33
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.

Fix slow rendering in node/edge styling
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/aws/graph-explorer/pull/542

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy