The short version of the question:
How much does it cost to call an Objective-C method from AppleScript as compared to the cost of calling it in “pure” Objective-C?
The somewhat longer version:
I am well aware of that coercing data back and forth between Objective-C and AppleScript comes at a rather significant cost if the amount of data is somewhat large, such as list to NSArray, record to NSDictionary, etcetera. For single calls this is usually not noticed, but in long loops this may be noticeable.
Assuming the data can stay in Cocoa/Objective-C form, such as an NSArray, and I pass it between 20 methods, and the whole thing is run in a loop 5 000 times, there are 100 000 calls, but no coercing. If I do this in ASOC (using an AppleScript loop), how much extra does that cost compared to doing the same thing in “pure” Objective-C?
An alternative is to stay within ASOC and its AppleScript loop, but do the same thing with AppleScript methods. Of course, no one can say how much slower or faster that could be (in the general case) but I know there are cases where it is significantly faster to do things with an “ugly” TID based solution rather than coerce to NSString and call componentsSeparatedByString_ on it. I am only saying this as a possible alternative for simple cases, but I would expect that if I can keep the data as an Objective-C class and calling methods on it, it would be faster in most cases, but perhaps not necessarily so?