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

chore(context-pad): update position once per frame #920

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

nikku
Copy link
Member

@nikku nikku commented Jun 28, 2024

Proposed Changes

As shown in this flame graph, in a huge diagram, we spend substantial amount of time to re-compute canvas viewport (after select) and determine context pad position (to update it):

capture GJzwNS_optimized

All this happens within the user transaction, and blocks UI interactivity.

With this PR we batch position updates as we batch visibility updates; we'll otherwise force the browser into expensive in-frame repaints:

image

Related to #915, camunda/camunda-modeler#4335.

Checklist

To ensure you provided everything we need to look at your PR:

  • Brief textual description of the changes present
  • Visual demo attached
  • Steps to try out present, i.e. using the @bpmn-io/sr tool
  • Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

We'll otherwise force the browser into expensive re-flows.
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Jun 28, 2024
@nikku nikku requested review from marstamm and barmac June 28, 2024 08:06
Copy link
Contributor

@marstamm marstamm left a comment

Choose a reason for hiding this comment

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

I could not break it, great performance improvement!

@marstamm
Copy link
Contributor

marstamm commented Jul 4, 2024

Unrelated to this PR, but it seems like the scheduler tests consistently fail on CI Linux

@nikku
Copy link
Member Author

nikku commented Jul 4, 2024

Follow-up to the Firefox test failures: #921.

@nikku nikku merged commit dadec48 into develop Jul 4, 2024
8 of 10 checks passed
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Jul 4, 2024
@nikku nikku deleted the batch-update-position branch July 4, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants