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

Modeling operations become slow in large diagram #4320

Closed
3 of 10 tasks
nikku opened this issue May 29, 2024 · 5 comments
Closed
3 of 10 tasks

Modeling operations become slow in large diagram #4320

nikku opened this issue May 29, 2024 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nikku
Copy link
Member

nikku commented May 29, 2024

Describe the bug

Working on a large BPMN diagram there is a slowness when completing modeling actions, cf. large-diagram.bpmn.txt.

screenshot POWWfO

Steps to reproduce

  1. Open large-diagram.bpmn.txt
  2. Do any modeling operation
  3. Perceive slowness, editor unresponsive (> 2s of wait time)

Expected behavior

Environment

  • OS: Linux
  • Camunda Modeler Version: v5.23.0
  • Execution Platform: Camunda 8
  • Installed plug-ins: None

Additional context

Came up via internal feedback.

@nikku nikku added the bug Something isn't working label May 29, 2024
@nikku
Copy link
Member Author

nikku commented May 29, 2024

TODO

  • Analyze where we spend most of our time
  • (if needed) Expose metrics that allow us to debug such slowness

@nikku
Copy link
Member Author

nikku commented May 29, 2024

Analysis, executing space tool, time until editor is responsive again:

  • on demo.bpmn.io: ~1 second
  • on Desktop Modeler: ~3 seconds (93 errors detected)
  • on Web Modeler: ~8 seconds (963 errors detected)

@nikku
Copy link
Member Author

nikku commented May 30, 2024

Work Log

Updated core modeling dependencies to use on board (browser) facilities for critical operations (clear, closest) - bpmn-io/diagram-js#910, bpmn-io/bpmn-js#2182.

Simplifying clear was unfortunately a failed experiment.

@nikku nikku added the ready Ready to be worked on label May 30, 2024
@nikku nikku self-assigned this May 30, 2024
@nikku
Copy link
Member Author

nikku commented May 30, 2024

Detailed Analysis

Following up on the shallow analysis, here are some more details; using
large-diagram.bpmn.txt as a test subject in different environments.

demo.bpmn.io (stock bpmn-js)

  • Snappy experience
  • Make space (single frame): 480ms
    • Actual computation: 300ms
    • marker updating 70ms (remove dragging) + 60 ms (activate selection)

image

Desktop Modeler

Uses the minimap which adds a 30% (!) toll on rendering ➡️ bpmn-io/diagram-js-minimap#81; linting happens outside of update cycle, not the fastest, but manageable.

  • Feels slightly slower
  • Update total: ~700ms
  • Make space (single frame): 480ms
    • Actual computation: 300ms
    • minimap updating: 140ms
    • marker updating 90 ms + 100 ms
  • Lint (next frame): ~130ms

image

Web Modeler

Uses the minimap and many custom extensions, resulting in a massive performance blow. The diagram can barely be edited. Kapa.ai integration is responsible for more than 50% of the performance hit, linting everything three times completes the picture ➡️ https://github.com/camunda/web-modeler/issues/9606.

  • Really slow
  • Update total: 7s
  • Make space (single frame): 4.8s
    • Actual computation: 1s
      • minimap updating: 250ms
      • marker updating: 200 ms + 200ms
    • Kapa.ai widget computation: 2.6s
    • Linting (round 1, sync): 700ms
      • elementTemplateLintRule: 130ms
      • actual linting Linter#lint: 300ms
      • storing lint results: 70ms
      • another Kapa.ai update: 143ms
  • Linting (round 2, next frame): 700ms
  • Linting (round 3, next frame): 700ms

image

@barmac
Copy link
Collaborator

barmac commented Aug 13, 2024

Done. We can open individual issues.

@barmac barmac closed this as completed Aug 13, 2024
@bpmn-io-tasks bpmn-io-tasks bot removed the ready Ready to be worked on label Aug 13, 2024
@github-actions github-actions bot added this to the M80 milestone Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants