@David We are using the same versions. This used to work instantly as well, this particular function is more than two years old. I can't imagine what has changed.
Our project suite is for a family of products where a common project houses API functions to interact with our apps. The processName parameter is passed using a global variable (__executableName) within a script unit named IVariables, which is dedicated to global variables for the entire suite. Our processName is by default "Spiricon.Version5" unless updated by a test run for a specific variant of this product family. I've copied this logic to a separate unit and tried it there and it performed the same way.
*As I typed this reply, I tried only passing in the string, but commenting out the Sys.Refresh and it was speedy once again. In fact now anything I pass in works fine. However, if I include the refresh call again its still slow. I guess the big question now is, have you ever seen anything cause Sys.Refresh() to go into a tizzy? I understand that sometimes it can be slow, but not the 2-3 minutes that I'm seeing now.
@Alexei I suppose I can change this function to work like that, your mockup works fine btw. It would eliminate the need for the refresh, but the refresh is used in other functions as well and I'm seeing the same performance problem there too.