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

Improve performance by avoiding repeated recalculateRenderedStyle #3309 #3310

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

YinDongFang
Copy link

@YinDongFang YinDongFang commented Dec 19, 2024

Cross-references to related issues. If there is no existing issue that describes your bug or feature request, then create an issue before making your pull request.

Associated issues:

Notes re. the content of the pull request. Give context to reviewers or serve as a general record of the changes made. Add a screenshot or video to demonstrate your new feature, if possible.

  • Avoid repeated render to improve performance.
    In my local environment, redraw time descrease from 130-140ms to 5-9ms when parellel bezier edges count is 100.
    redraw time descrease from 3200-3400ms to 25-35ms when parellel bezier edges count is 500.

Checklist

Author:

  • The proper base branch has been selected. New features go on unstable. Bug-fix patches can go on either unstable or master.
  • Automated tests have been included in this pull request, if possible, for the new feature(s) or bug fix. Check this box if tests are not pragmatically possible (e.g. rendering features could include screenshots or videos instead of automated tests).
  • The associated GitHub issues are included (above).
  • Notes have been included (above).

Reviewers:

  • All automated checks are passing (green check next to latest commit).
  • At least one reviewer has signed off on the pull request.
  • For bug fixes: Just after this pull request is merged, it should be applied to both the master branch and the unstable branch. Normally, this just requires cherry-picking the corresponding merge commit from master to unstable -- or vice versa.

@maxkfranz maxkfranz self-requested a review January 8, 2025 15:36
@@ -756,7 +735,7 @@ BRp.findEdgeControlPoints = function( edges ){
let srcIndex = src.poolIndex();
let tgtIndex = tgt.poolIndex();

let pairId = [ srcIndex, tgtIndex ].sort();
let pairId = `${srcIndex}_${tgtIndex}_${edgeIsUnbundled}`;
Copy link
Member

Choose a reason for hiding this comment

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

This needs to have the IDs sorted, because a bezier bundle can contain edges that go in either direction, e.g.

E1: A -> B
and
E2: B ->A
could both be in the same bundle

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