# Slow Rendering for big diagrams

**URL:** <https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897>\
**Category:** Modeler\
**Created:** [July 22, 2016, 8:27am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897 "2016-07-22T08:27:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhildabral](https://forum.bpmn.io/user_avatar/forum.bpmn.io/akhildabral/32/371_2.png) [@akhildabral](https://forum.bpmn.io/u/akhildabral)\
**Post date:** [July 22, 2016, 8:27am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/1 "2016-07-22T08:27:43Z")

</div>

Hello,

I was testing the performance of the modeling framework for huge files. Opening a bpmn model with around more then 500 tasks is taking time to load and once loaded moving tasks or connections takes times to render.

![](https://forum.bpmn.io/uploads/default/original/1X/22863da61a9567de9094ff4d86bd7a9bbcea245e.png)

The image attached shows the time it took for the “tools:state-change” event to generate. This time gradually increases as the tasks in the model are increased.

I have run 1K 5K and 10K task tests.

Also is there any way to restrict the viewport to render only the view area and perform lazy loading?

Any pointers will be really heplful.

Thanks

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2016, 11:35am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/2 "2016-07-22T11:35:31Z")

</div>

> The image attached shows the time it took for the “tools:state-change” event to generate. This time gradually increases as the tasks in the model are increased.

That is the expected behavior. We did not do any optimizations here. But huge diagrams will naturally slow down importing and rendering by a fair bit. You got other cost as well though, such as the fact that you will not be able to understand these diagrams anymore beyond a certain size.

> Also is there any way to restrict the viewport to render only the view area and perform lazy loading?

Nope, that is not possible right now.

We may be able to look into specific issues, if you post them. Please include the samples, the toolkit version you use and your OS / hardware configuration.

---

<div class="post-metadata">

**Author:** ![akhildabral](https://forum.bpmn.io/user_avatar/forum.bpmn.io/akhildabral/32/371_2.png) [@akhildabral](https://forum.bpmn.io/u/akhildabral)\
**Post date:** [July 25, 2016, 3:16am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/3 "2016-07-25T03:16:57Z")

</div>

Hi Nikku,

Thanks for quick reply.

I understand this is not an issue for the basic bpmn usecase. I am trying to use it for some extensive task.  
Can you give me some pointers what could be causing this issue? The issue is happning when a diagram element is dropped on the canvas.

Any module if u can point me to , where i can look into and try to do some fix.

System Config :  
Camunda Modeler : v1.2.0 (build 1467721604)  
Node : v4.4.7  
OS : Windows 10 64bit 8gig

This is a test model i have generated to test.  
[500Actions\_Camunda.bpmn](https://forum.bpmn.io/uploads/default/original/1X/e2b71272f528c5f42497fb7ecc4479c4e495d7ba.bpmn) (369.0 KB)

Thanks

---

<div class="post-metadata">

**Author:** ![akhildabral](https://forum.bpmn.io/user_avatar/forum.bpmn.io/akhildabral/32/371_2.png) [@akhildabral](https://forum.bpmn.io/u/akhildabral)\
**Post date:** [July 26, 2016, 9:46am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/4 "2016-07-26T09:46:48Z")

</div>

Nikku, i have drilled it down to the part which is making the rendered slow.

> <https://github.com/bpmn-io/diagram-js/blob/master/lib/core/GraphicsFactory.js#L113>

  
the forEach loop is looping through all the diagram elements. If i skip this part everything is working smooth.

But i didnt understand the implecation of that. What is this forEach loop getting used for?

Can you explain this? 😓

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 26, 2016, 9:50am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/5 "2016-07-26T09:50:07Z")

</div>

The loop makes sure that diagram elements have their correct respective parents (i.e. you moved a task, the task has to be moved in the SVG, too).

In which phase did into the the loop? Import, update?

---

<div class="post-metadata">

**Author:** ![akhildabral](https://forum.bpmn.io/user_avatar/forum.bpmn.io/akhildabral/32/371_2.png) [@akhildabral](https://forum.bpmn.io/u/akhildabral)\
**Post date:** [July 26, 2016, 10:05am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/6 "2016-07-26T10:05:19Z")

</div>

Its while updating. When ever a element is moved/repositioned in the canvas, its getting all the diagram elements and itterating through. Do we need update the entire model?

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 26, 2016, 11:44am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/7 "2016-07-26T11:44:22Z")

</div>

We need to pick up only the elements that changed.

---

<div class="post-metadata">

**Author:** ![SimonSteinruecken](https://forum.bpmn.io/user_avatar/forum.bpmn.io/simonsteinruecken/32/6531_2.png) [@SimonSteinruecken](https://forum.bpmn.io/u/SimonSteinruecken)\
**Post date:** [July 15, 2025, 10:28am UTC](https://forum.bpmn.io/t/slow-rendering-for-big-diagrams/897/8 "2025-07-15T10:28:16Z")

</div>

Closed on July 15, 2025, 10:28am UTC


