# Tag writing performance in Ignition custom module

**URL:** <https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882>\
**Category:** Ignition\
**Tags:** sdk\
**Created:** [December 16, 2024, 3:28pm UTC](https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882 "2024-12-16T15:28:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BenS](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@BenS](https://forum.inductiveautomation.com/u/BenS)\
**Post date:** [December 16, 2024, 3:28pm UTC](https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882/1 "2024-12-16T15:28:44Z")

</div>

Hello,

I am using the following function to write tags to a tag manager given a map of tag paths and values:

```python
public class TagValueWriter {

    public void writeTagValues(Map<String, Object> tagValues) throws TagWriteException {
        try {
            for (Map.Entry<String, Object> entry : tagValues.entrySet()) {
                GatewayHook.ourProvider.updateValue(entry.getKey(), entry.getValue(), QualityCode.Good);
            }
        } catch (Exception e) {
            throw new TagWriteException("Failed to write tag values", e);
        }
    }
}

```

This doesn't seem to be very efficient since it writes each tag individually, calling GatewayHook.ourProvider.updateValue each time. Is there a more optimal way to write all the tags in the map to the tag manager?

Thank you!

---

<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:** [December 16, 2024, 3:37pm UTC](https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882/2 "2024-12-16T15:37:41Z")

</div>

If your module provides a ManagedTagProvider this is the intended way to update tag values for tags it provides.

This is different than "writing tags" in general, which would be done via the TagManager interface.

---

<div class="post-metadata">

**Author:** ![BenS](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@BenS](https://forum.inductiveautomation.com/u/BenS)\
**Post date:** [December 16, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882/3 "2024-12-16T15:46:14Z")

</div>

Thanks for the response, @Kevin.Herron. So, to clarify, when using a ManagedTagProvider (which I do), there is no way to batch write all the tags or something like that? I am concerned about the performance of my module because, while my data source is updating every second, I am only seeing roughly every third update from my data source in a given tag.

For context, the tag provider has about 30,000 tags.

---

<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:** [December 16, 2024, 3:58pm UTC](https://forum.inductiveautomation.com/t/tag-writing-performance-in-ignition-custom-module/99882/5 "2024-12-16T15:58:14Z")

</div>

You aren't "writing" in the same way a tag write would, you're directly updating the source.

At this level a method that accepted a list of tags and values would just be doing a loop to process them anyway.
