Re: Speed & Choose from list
Re: Speed & Choose from list
- Subject: Re: Speed & Choose from list
- From: Arthur J Knapp <email@hidden>
- Date: Wed, 08 May 2002 10:40:20 -0400
>
Subject: Re: Speed & Choose from list
>
From: email@hidden (Michael Sullivan)
>
Date: Tue, 7 May 2002 22:16:21 -0400
>
email@hidden (Stephen Swift) writes:
>
>
> But as most agreed, all options were fast and easy to use. I just found it
>
> interesting trying to figure out which was the most efficient if it had to
>
> run through a huge huge list (looking at the amount of code & speed).
>
One thing I should note here. The lists you tested are not huge at all,
>
though they are about as large as one would ever pipe to a "choose from
>
list" command.
It is interesting to actually send large lists to choose from list. I have
not yet found an upper limit. :)
>
On lists that store a lot of information, and might contain, say 1000 or
>
10,000 items, the efficiency of using tids to get the O(n) constant down
>
at machine level, or of the log(n) binary search algorithm would make
>
itself known.
With regard to the very large, it should be pointed out that tids-
processing is subject to a coercion limit, (AppleScript will not return
more than approxamately 4050 some items from a single coercion). The
binary "contains" search may also be subject to some upper limit. The
contains operator certainly has limits when it's operands are strings,
(32k), so it is likely that some similar limit is true for lists.
>
On lists below 100 items, a simple "bad" algorithm will often beat more
>
complicated "better" algorithms, because the setup time for the more
>
complicated algorithms adds a large constant.
Right. The search handler that I posted is in need of a cut-off point
for switching to a simple traversal, (probably somewhere around 10 to 25
items should do).
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://www.facespan.com/>
on error number -128
end try
}
_______________________________________________
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.