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

Various perf fixes for loading tutorials #9745

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Conversation

riknoll
Copy link
Member

@riknoll riknoll commented Oct 24, 2023

Fixing a couple perf issues:

  1. We call stopSimulator several times when loading a project/tutorial. Each time this is called, it causes two setStates on app.tsx even if the simulator is already stopped. Added some code to prevent that
  2. Removed a query selector in TutorialContainer

Also fixed an exception I noticed while debugging this; the VerticalResizeContainer was subscribing/unsubscribing events in an unsafe way. Also, it was doing a query selector in the render function which is never safe to do; always put dom manipulation inside a useEffect hook so it's guaranteed to run after the dom has rendered.

@riknoll riknoll requested review from thsparks and a team October 24, 2023 17:48
Copy link
Contributor

@thsparks thsparks left a comment

Choose a reason for hiding this comment

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

Thank you!

@riknoll riknoll merged commit 669aa27 into master Oct 24, 2023
7 checks passed
@riknoll riknoll deleted the dev/riknoll/tutorial-fixes branch October 24, 2023 20:01
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.

2 participants