Re: do shell script speed (URL Access Redux)
Re: do shell script speed (URL Access Redux)
- Subject: Re: do shell script speed (URL Access Redux)
- From: Emmanuel <email@hidden>
- Date: Thu, 25 May 2006 01:46:26 +0200
At 11:59 AM -0700 5/23/06, Christopher Nebel wrote:
On May 23, 2006, at 2:48 AM, Emmanuel wrote:
[...]
The big problem with do shell script is that it is awfully slow. We
publish a page about that at:
<http://www.satimage-software.com/test_05_08/speed_test_result.html>
[...] The slowdown is entirely attributable to a switch from
vfork(2) to fork(2) to create the new process. This was done for
reasons of correctness -- "do shell script" does things in between
the fork and the exec that are not allowed, but which happened to
work in 10.3. [...]
Great you explained that, thanks. We updated the page above.
For a happy ending, I recall that do shell script's AppleScripty
competitor, that is, having Terminal run in the background and
scripting it, may make an efficient solution.
I report a quick test with "ls":
do shell script "ls"
-- 24 ms
tell application "Terminal" to do script "ls ../../ > a" in window 1
read alias "emmanuel's hd1T:Users:emmanuel:a" as «class utf8»
-- < 3 ms
As someone else recalled, AppleScript is primarily an
interapplication language. The good news is: it is fast like a
greased lightning.
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden