• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Speeding Up Scripts 101
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Speeding Up Scripts 101
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Speeding Up Scripts 101 (From: Malcolm Fitzgerald <email@hidden>)

  • Prev by Date: Re: Damn send button / Wind chill
  • Next by Date: Re: Speeding Up Scripts 101
  • Previous by thread: Re: Speeding Up Scripts 101
  • Next by thread: Re: Speeding Up Scripts 101
  • Index(es):
    • Date
    • Thread