Hi All,
We've been working on the performance of some automation scripts.
We found that if we call
element.GetParameterByPrimaryKey(columnPid, primaryKey);
it takes 5 seconds to retrieve the parameter value.
If we use
element.GetParameter(columnPid, primaryKey);
It only takes a few milliseconds to retrieve a parameter value.
What's the difference between the two, and why would the first one need multiple seconds to retrieve a parameter value?
Hi,
A GetParameterByPrimaryKey in the background first needs to do a lookup of the display key that matches with the primary key, after that it will call GetParameter which relies on the display key.
In other words, a GetParameter will always be faster compared to a GetParameterByPrimaryKey. Why in this case it is taking several seconds, I don't know at first sight. An analysis would further need to be done for this, perhaps the size of the table could have some involvement.
Regards,