# Tag Script or Gateway Script

**URL:** <https://forum.inductiveautomation.com/t/tag-script-or-gateway-script/38610>\
**Category:** General Discussion\
**Tags:** ignition80, scripting\
**Created:** [September 11, 2020, 7:51pm UTC](https://forum.inductiveautomation.com/t/tag-script-or-gateway-script/38610 "2020-09-11T19:51:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [September 11, 2020, 7:51pm UTC](https://forum.inductiveautomation.com/t/tag-script-or-gateway-script/38610/1 "2020-09-11T19:51:38Z")

</div>

Hi  
I have script and working fine when I did it on Gateway script or tag script ,my question is  
Which is the right way for the system performer, Build script on tag script or on the Gateway script?

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [September 13, 2020, 10:16am UTC](https://forum.inductiveautomation.com/t/tag-script-or-gateway-script/38610/2 "2020-09-13T10:16:09Z")

</div>

Both have same performance. So no different.  
But in use case is different.  
Use tag script for situation where you have object ordient design. For example you create UDT for flow meter and yup want to totalize it to calculate volume.  
You better put your code in tag change script.  
But for globally approach you use gateway script.

---

<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:** [September 13, 2020, 11:28am UTC](https://forum.inductiveautomation.com/t/tag-script-or-gateway-script/38610/3 "2020-09-13T11:28:17Z")

</div>

They do not have the same performance: tag events are in a limited thread pool with a queue limit.  
Tag events are also limited to calling scripts in the global scripting module. Gateway tag change events can call scripts in their own project. And they are enabled/disabled with the project as a whole, without having to disable the subscribed tag.

I avoid tag events like the plague.
