# Adding points to Point List Markup becomes progressively slower

**URL:** <https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419>\
**Category:** Development\
**Tags:** markups\
**Created:** [May 13, 2022, 9:53pm UTC](https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419 "2022-05-13T21:53:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Hahn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/karl_hahn/32/15290_2.png) [@Karl\_Hahn](https://discourse.slicer.org/u/Karl_Hahn)\
**Post date:** [May 13, 2022, 9:53pm UTC](https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419/1 "2022-05-13T21:53:40Z")

</div>

Adding points to Point List Markup becomes progressively slower. It reached multiple seconds to add a point after about 30 points. This does not occur when adding points to e.g. a closed curve.

Please let me know if I can provide any other information. Thanks!

Slicer 5.1, Windows 10 21H2, i7-7820HQ, 32 GB RAM, Quadro M1200

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 14, 2022, 10:43pm UTC](https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419/2 "2022-05-14T22:43:56Z")

</div>

If you add more than one point then I would recommend to do it in one batch: call `StartModify`, add your points, and call `EndModify`. This avoids unnecessary updates.

You can play around with the “AddManyMarkupsFiducialTest” test module. To see what performance you can get. For me, time required for adding 50 points without any event optimization takes 280ms, while with StartModify/EndModify it just takes 46ms. Adding 5000 points takes just 234ms.

if you need to visualize more than a few hundred points and you don’t need to interact with each point separately then you may consider using a model node instead. That can visualize hundreds of thousands of points at interactive frame rates.

---

<div class="post-metadata">

**Author:** ![Karl\_Hahn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/karl_hahn/32/15290_2.png) [@Karl\_Hahn](https://discourse.slicer.org/u/Karl_Hahn)\
**Post date:** [May 14, 2022, 11:52pm UTC](https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419/3 "2022-05-14T23:52:06Z")

</div>

Hi Andras, thanks for the response.

I see that I wrongly put this question in the “Development” category, when it should likely be in “Support”.

My question deals with the UX of the vanilla Slicer app, without any modification.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 15, 2022, 2:47am UTC](https://discourse.slicer.org/t/adding-points-to-point-list-markup-becomes-progressively-slower/23419/4 "2022-05-15T02:47:51Z")

</div>

Currently, update of the `Control Points` section in Markups module is slow. I’ve added a bug report to keep track of this issue:

> <https://github.com/Slicer/Slicer/issues/6379>
>
> Adding new markup control points is very slow if Markups module is active and co…ntrol points table is visible.
> 
> \## Steps to reproduce
> 
> \- Create a \`Point list\` markup
> \- Add 100 control points
> \- Add one more control point - it takes a fraction of a second
> \- Go to Markups module, open Control points section
> \- Add one more control point - it takes several seconds
> 
> \## Expected behavior
> 
> Adding a control point should only take a fraction of a second.
> 
> \## Environment
> \- Slicer version: Slicer-5.1.0-2022-05-08
> \- Operating system: Windows10

As a workaround, you close the `Control points` section in the Markups module (or switch to a different module) while adding points.
