• 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: really slow repeat loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: really slow repeat loop


  • Subject: Re: really slow repeat loop
  • From: "Shane Stanley" <email@hidden>
  • Date: Wed, 19 Jan 2005 12:51:39 +1100

On Tue, 18 Jan 2005 17:37:53 -0800, Andrew Oliver wrote:

>>             set end of user_list to username
>>         end if
>>     end repeat
>>
>>
>
>As has been covered many times before, when appending to a list it is far,
>far faster to:
>
>   copy username to end of user_list
>
>Since it involves less memory moving, especially with large lists.

Really? This suggests otherwise:

set x to {}
set time1 to current date
repeat with i from 1 to 2000
	copy i to end of x
end repeat
set time2 to current date
set x to {}
set time3 to current date
repeat with i from 1 to 20000
	set end of x to i
end repeat
set time4 to current date
{time4 - time3, time2 - time1}


--
Shane Stanley  <email@hidden>


 _______________________________________________
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

  • Follow-Ups:
    • Re: really slow repeat loop
      • From: Andrew Oliver <email@hidden>
References: 
 >Re: really slow repeat loop (From: Andrew Oliver <email@hidden>)

  • Prev by Date: Re: really slow repeat loop
  • Next by Date: Re: really slow repeat loop
  • Previous by thread: Re: really slow repeat loop
  • Next by thread: Re: really slow repeat loop
  • Index(es):
    • Date
    • Thread