Re: Unexplained speed boost, run script
Re: Unexplained speed boost, run script
- Subject: Re: Unexplained speed boost, run script
- From: bryan <email@hidden>
- Date: Sun, 07 Jul 2002 12:41:31 -0400
I have a script that runs about 7x faster in Smile than by itself.
I wish I knew how they are doing it. The difference is so profound that
I use Smile as the environment to run the main script in and have other
scripts controlling Smile.
I had not used the technique you showed in your post, I was running it
from a script window.
I just rewrote all my scripts to use your method.
Thanks.
Bryan Kaufman
Jay wrote:
>
I began with a simple droplet script that passed a list of files
>
dropped on it to a repeat loop. Smile then opens and converts each
>
file to a text file. All of this is written in the main body of the
>
script.
>
>
Then, assuming that the script inside the repeat loop was as good as
>
I could make it, I started looking for "tricks" to make it go faster.
>
I set up a test folder containing 96 test files (compiled scripts),
>
and used Jon's for OSX to create a timing routine. Now, after about 8
>
hours of testing, I have some very consistent results, and I did find
>
the "trick" I was looking for. I just can't entirely explain it
>
though.
>
>
First I tried putting the repeat loop in a handler and passing it the
>
dropped files from the main body of the script:
>
>
ScriptToText(dropedFils)
>
>
on ScriptToText(selectedFiles)
>
bla bla
>
end ScriptToText
>
--average time 72 seconds No increase in speed here. Same as in main
>
body of script
>
>
Next I tried breaking the script into a droplet - compiled script
>
combo linked by "run script." The called script contains exactly the
>
same routine as the handler version.
>
>
run script file (myFold & ":scpt->text") with parameters {dropedFils}
>
--average time 70 seconds Modest speed boost
>
>
Then, accidentally, I put the "run script" statement inside a tell
>
Smile block in the droplet.
>
>
tell application "Smile"
>
launch
>
activate
>
with timeout of 9600 seconds
>
run script file (myFold & ":scpt->text") with parameters {dropedFils}
>
end timeout
>
end tell
>
--average time 58 seconds Speed is more than 20% faster than next
>
fastest method!!
>
>
I just got a clue at to what might be going on. The droplet (the fast
>
one) calling the script quit unexpectedly, and everything kept right
>
on going to completion without an error!!!
>
>
I tested this several times with both of the 'run script' droplets.
>
If the run script command is outside the Smile tell block then
>
everything halts if the droplet is interrupted. If the run script
>
command is inside a tell Smile block and the droplet is interrupted,
>
completion of the script continues to the end of the script.
>
>
Does this mean:
>
1. that Smile is handling the 'run script?' I don't see anything in
>
the dictionary to support that.
>
>
2. that Smile is faster than AppleScript at running AppleScript? ;-)
>
>
If anyone wishes it, I will post the scripts. They are not long, but
>
are too long for this post.
>
>
Jay
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
[demime 0.98b removed an attachment of type text/x-vcard which had a name of bryan.vcf]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.