Tag writing performance in Ignition custom module

Hello,

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

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!

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.

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.

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.