Difference between WriteBlocking with multiple tags or multiple writeblocking for multiple tags

Can i check what would be the difference between the below 2 ways of writing to 2 tags?
Which is a more appropriate method to use and the advantages vs disadvantages?

Method 1: Combine both tags in 1 writeblocking command
system.tag.writeBlocking([strTagPath+‘intStatus’,strTagPath+‘boolStringToDataset’],[0,1])

Method 2: Separate writeblocking command for each tag:
system.tag.writeBlocking([strTagPath+‘boolStringToDataset’],[1])
system.tag.writeBlocking([strTagPath+‘intStatus’],[0])

This one will be faster:

The second option will block your script for roughly twice as long, waiting for the first write to complete before starting the second write, and then waiting for second write to complete.

1 Like

I was wondering the same thing, but with writeAsync.
Would 10 calls of writeAsync for 10 tags be slower than 1 call for 100 tags ?
When (if ever) would it become more efficient to split the calls ?

I would say never. I think multiple is always going to be more efficient

4 Likes