Re: Speeding Up Scripts 101
Re: Speeding Up Scripts 101
- Subject: Re: Speeding Up Scripts 101
- From: James Sentman <email@hidden>
- Date: Sun, 3 Mar 2002 23:05:50 -0500
I would very much like to find a repository of script speed info.
I'll start you off with one;) I'm trying to shave some seconds off
the code that generates these rather large tables for a motion sensor
report.
The code does a lot of things like:
set MyOutput to MyOutput & "some more data" & return & "a little bit more"
After doing a bunch of experimenting I've found that doing:
set MyOutput to {MyOutput, "some more data", return, "a littlemore"} as string
is considerably faster. I tried various other things, like just
creating one long list and coercing it to a string at the return
statement, but that was slower than the concatenation. I also tried
statements like:
copy {"some more data", return, "a little more"} to the end of MyOutput
or
set the end of MyOutput to {"some more data", return, "a little more"}
but that also wasn't as fast.
It's little things like this that make the difference, especially in
large loops. I'm sure that people with more scripting experience have
learned a lot of this kind of info!
Thanks,
James
--
_________________________________________________________________________
James Sentman <email@hidden>
http://www.sentman.com
Enterprise server monitoring with:
http://whistleblower.sentman.com/
_______________________________________________
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.