Tag Read During Tag Change Script Performance

I’ve got a tag change script that will need to read some other tags on the gateway, but one of those tags is an “enable” for the rest of the script. Is there any advantage to reading the one “enable” tag first, and then reading the rest if it’s actually enabled? Or, would that actually negatively impact the performance of the script since it will now have 2 calls to system.tag.readBlocking() instead of 1 (when enabled, of course).

My intuition is telling me that a single read vs 2 reads is going to be better unless we’re talking 1000+ tags.

Thoughts?

I haven’t done any bench testing, but on a customer project that doesn’t have transaction groups; I read all tags, and if machine status is auto, write to the DB. So I opted for the single read call.

With the SF functions I hope!

1 Like

Of course aha.

1 Like

If you are dynamically generating the corresponding tag paths, I'd use a separate read to avoid the path list generation. If the list is static (or cached in a script module top level dictionary), I'd read up to a hundred or so unconditionally.

1 Like

It’s a static list of other tags within the same UDT