# Execution of Expression Tags are taking more time than expected

**URL:** <https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109>\
**Category:** Ignition\
**Created:** [May 1, 2023, 7:26pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109 "2023-05-01T19:26:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eduardo\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@Eduardo\_Aguirre](https://forum.inductiveautomation.com/u/Eduardo_Aguirre)\
**Post date:** [May 1, 2023, 7:26pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/1 "2023-05-01T19:26:09Z")

</div>

I have a UDT with some OPC Tags, Query Tags and expression tags.  
-The first tag is a counter from PLC thats is being read each 1 Second (No issue. Working good)

-Then I have an expression tag that is no more than a target set in database. I'm just filtering a Dataset Tag in my gateway to bring that value each minute(No issue).

-Finally the tag with the issue is just an expression tag and the value is the difference between the target - PLC Counter, the execution time supoused to be each second but is taking around 5 or 6 to do it.

I have around 14500 tags in my server and the performance on that is CPU\<40%

Any idea about what could giving me that problem?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 1, 2023, 9:53pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/2 "2023-05-01T21:53:38Z")

</div>

Tip: use `'-'` for bulleted lists. Use `'>'` to quote someone else. You appear to be quoting yourself in your post and it causes some confusion.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 1, 2023, 9:54pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/3 "2023-05-01T21:54:39Z")

</div>

What version of Ignition is this?

---

<div class="post-metadata">

**Author:** ![Eduardo\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@Eduardo\_Aguirre](https://forum.inductiveautomation.com/u/Eduardo_Aguirre)\
**Post date:** [May 2, 2023, 1:51pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/4 "2023-05-02T13:51:22Z")

</div>

Is Ignition 8.1.24

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2023, 1:56pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/5 "2023-05-02T13:56:10Z")

</div>

Can you download a few thread dumps from the gateway and share them? It's possible you have some slow running expressions or something like that.

[https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Threads#DiagnosticsThreads-IndividualThreads](https://docs.inductiveautomation.com/display/DOC81/Diagnostics+-+Threads#DiagnosticsThreads-IndividualThreads)

It may be easier to call support and let them have a look at your system.

---

<div class="post-metadata">

**Author:** ![Eduardo\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@Eduardo\_Aguirre](https://forum.inductiveautomation.com/u/Eduardo_Aguirre)\
**Post date:** [May 2, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/6 "2023-05-02T16:00:27Z")

</div>

Thank you Kevin, I just opened a ticket with support!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 2, 2023, 4:04pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/7 "2023-05-02T16:04:54Z")

</div>

I peeked at the thread dumps you provided supported. In all of them there are stack traces that show you using @pturmel's simulation aids module `view` function, and in some of them all of the expression execution threads are tied up calling that.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 2, 2023, 4:10pm UTC](https://forum.inductiveautomation.com/t/execution-of-expression-tags-are-taking-more-time-than-expected/73109/8 "2023-05-02T16:10:37Z")

</div>

Hmmm. I suppose that shouldn't be a surprise. `view()` is very much intended for use in UIs, driven by changes in references, not on a pace as would happen in a tag group.

I recommend using `view()`'s DEBUG logger to obtain the script it is using, and move large-scale filtering operations across many tags into a single timer event script. Less script overhead, and provides the opportunity to produce multiple output datasets in a single pass through a source dataset.
