Does requesting one single parameter using the method GetParameters perform less well than using the method GetParameter?
If you put a magnifying glass on it then the answers is yes, as it requires more resources.
- On SLScripting side:
- You need to construct the "new" uint[], which is present on the heap. While if Parameter.model is directly used then it doesn't need the extra item on the heap
- You need to the return object[], which is also present on the heap. One item containing the array, another item containing the string value. That then also needs to be accessed. While if the GetParameter is directly used you have direct access.
- On SLProtocol side:
- It needs to iterate over the items in the object array
- It needs to construct the result in an object array
Will the difference be noticeable? Probably not, but my personal preference would be if you only need to get 1 parameter that the GetParameter call is executed as the overhead is avoided and the code is also more readable. But if you need to retrieve more parameters then get them in one call as it reduces the inter process calls.