Re: Sifting a list sans loop
Re: Sifting a list sans loop
- Subject: Re: Sifting a list sans loop
- From: "Jason W. Bruce" <email@hidden>
- Date: Tue, 29 Jan 2002 18:41:53 +0000
Marc K. Myers asked:
>
Is there a limit to list size, other than available memory? Why does
>
adding items to the end of a list get slow when the list is large?
It could be because the list has become so large that it has to be shuffled
around in memory several times to complete the appending of new items.
Below is an excerpt from Chris Nebel from a post a few weeks back explaining
the difference between copy and set with lists.
>
--Chris Nebel
>
AppleScript Engineering
>
>
[1] Astute readers will realize that AppleScript has to copy the list
>
at least sometimes, because there might not be room for the new
>
element. AppleScript currently grows lists by 16 slots at a time, so
>
you only need to copy the list once for every 16 appends, instead of
>
every time with concatenation. (Yes, I know that a different
>
algorithm -- e.g. doubling the slots -- would be more time-efficient.
>
I'm working on it.)
Jason Bruce