• 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: applescript-users digest, Vol 3 #2735 - 22 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 3 #2735 - 22 msgs


  • Subject: Re: applescript-users digest, Vol 3 #2735 - 22 msgs
  • From: Matthew Strange <email@hidden>
  • Date: Thu, 3 Jun 2004 23:51:42 -0400

On Jun 3, 2004, at 9:35 PM, Paul Berkowitz wrote:

I want to manipulate a list by taking some items out....

You can improve performance by using 'set' rather than copy...

I normally trust Paul's advice without question, but this assertion caught me off guard. So I did some testing, and at its simplest level, copy and set seem to me to be identical. On my G4/1.2GHz running 10.3.4...

set ListA to {}
repeat 10000 times
copy "a" to the end of ListA
end repeat
takes 23 seconds

set ListB to {}
repeat 10000 times
set the end of ListB to "a"
end repeat
takes 23 seconds

Identical timing, which leads me to ask: "why does Paul say set is more efficient than copy?"
Matt Strange
email@hidden

PS: the 'other' method of concatenating a list takes 48 seconds (twice as long)...
set ListC to {}
repeat 10000 times
set ListC to ListC & "a"
end repeat
_______________________________________________
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: applescript-users digest, Vol 3 #2735 - 22 msgs
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Any way in applescript to use an image as a folder icon?
  • Next by Date: Re: applescript-users digest, Vol 3 #2735 - 22 msgs
  • Previous by thread: Re: Any way in applescript to use an image as a folder icon?
  • Next by thread: Re: applescript-users digest, Vol 3 #2735 - 22 msgs
  • Index(es):
    • Date
    • Thread