camunda / camunda-modeler

An integrated modeling solution for BPMN, DMN and Forms based on bpmn.io.
https://camunda.com/products/modeler
MIT License
1.51k stars 484 forks source link

No loop rule significantly reduces the application performance on big diagrams #4401

Closed barmac closed 4 months ago

barmac commented 5 months ago

Describe the bug

The diagram from the support ticket makes the application unresponsive, and this is due to the linting (no-loop rule).

image

Steps to reproduce

  1. Open the diagram from the support ticket
  2. now this happens

Expected behavior

The linting should not slow down the application significantly.

Environment

Additional context

SUPPORT-22488

barmac commented 5 months ago

Ideas:

  1. Run linter in a worker (difficult because we need to pass the model)
  2. Limit the number of elements tested for the no-loop rule

The rule is implemented in https://github.com/camunda/bpmnlint-plugin-camunda-compat/blob/main/rules/camunda-cloud/no-loop.js

nikku commented 5 months ago

Let's attempt to solve this in an algorithmic manner first. I suggest anyone picking to check the following (or other) resources: