Outrageously slow AppleScript performance

Richard Gaskin ambassador at fourthworld.com
Thu Oct 2 10:24:50 EDT 2014


Bill Vlahos wrote:

 > When I execute the AppleScript listed below in the AppleScript Editor
 > it works in about 1 second. Take the same script, put in in a
 > LiveCode field and do field “name” as AppleScript and it takes
 > between 1 and 2 minutes to do!
 >
 > 1. Why?
 > 2. How can I make it run quickly?

The time difference is big enough that I suspect Zyrip is on the right 
track:
<http://lists.runrev.com/pipermail/use-livecode/2014-October/206543.html>

But in general, executing AppleScript from LiveCode will almost always 
be somewhat slower than running the same script within Apple's 
AppleScript Editor for two reasons:

1. In AS, the interface to the AE subsystem is initialized when the app 
opens, but in LC it needs to be setup at runtime when the call is made.

2. In AS scripts are compiled before being run, but in LC we're passing 
a string to the AS subsystem, which it then has to compile before executing.

Neither of those should take quite that long, though.

If you're coming to tonight's LiveCode User Group meeting in Pasadena 
please bring your project and let's brainstorm ways to diagnose what's 
going on with it.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com




More information about the use-livecode mailing list