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: updating connections in the db multiple times #6859

Merged
merged 2 commits into from
Mar 1, 2023

Conversation

BeksOmega
Copy link
Collaborator

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Works on #6786 as a follow up to #6851

Proposed Changes

Separates out updating connection locations into a separate pass, specifically when using the render queue (normal immediate rendering is unaffected).

Reason for Changes

This means that we are no longer recursively moving all of the child blocks every time we tighten a parent block (which was causing us to do a lot of duplicate work adding and removing things from the connection db). It also eliminates a heck-ton of calls to getRelativeToSurfaceXY, which is a pretty expensive function.

This makes rerendering ~ 2.5x faster when you're moving a bunch of connections. E.g. when you're wrapping a new if-block around the spaghetti stress test blocks.

Test Coverage

Just manual testing =(

Documentation

N/A

Additional Information

Dependent on #6851

@BeksOmega BeksOmega marked this pull request as ready for review March 1, 2023 18:47
@BeksOmega BeksOmega requested a review from a team as a code owner March 1, 2023 18:47
@BeksOmega BeksOmega requested a review from maribethb March 1, 2023 18:47
core/render_management.ts Outdated Show resolved Hide resolved
core/render_management.ts Show resolved Hide resolved
core/rendered_connection.ts Outdated Show resolved Hide resolved
core/render_management.ts Outdated Show resolved Hide resolved
@BeksOmega BeksOmega merged commit bb6124a into google:develop Mar 1, 2023
@BeksOmega BeksOmega deleted the fix/connection-db-overhead branch May 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants