Hello community,
I am looking into setting about 10 parameters in the elements of a specific Protocol in a DMS.
Initially, since there were few elements the Element.SetParameter() was being used. However, now we are talking about 300 elements and I was thinking of using the SLNet message SetMultipleParametersMessage in order to reduce the amount of calls in the script.
Is it better to send a single SLNet Message with all Parameter Sets or in batches of X elements? Is there other ways to do this that are efficient?
Thank you!
Hi João,
The SetMultipleParametersMessage could be a good approach for that number of sets as it will allow you to interact with SLNet the minimum amount of times.
You could also send the "normal" SetParameterMessage multiple times however it will likely lead to a slightly slower implementation due to more inter-process communication.
Could you elaborate more on your use case?
Are those sets just to be used and sent to the device or is there any "preprocessing" done in a QAction for instance?
Depending on the purpose of those sets it could be advantageous to serialize them and setting to a single parameter which would then be deserialized on the connector side.
This of course would require that you are able to adapt the connector to allow for this and would depend on the actual use case to know if it is better or worse than the alternatives.
In that case, joining the sets in a bulk call like the SetMultipleParametersMessage would likely be the best approach.
Regarding doing it all at once or in batches it is hard to accurately say without testing as a few factors can affect the outcome, such as load on the system or where the elements are located in the cluster.
I would recommend testing it in 2 scenarios, all at once, and using it in chunks with a small sleep in between to give time for the processes to propagate the previous requests.
These sets are used to update credentials that are changed every time interval, so there’s no pre-processing or any other action needed on the elements.
In this case would it be better to have a larger SLNet call (with all parameter sets) or in batches?