Re: Need a faster Find Duplicates Routine
Re: Need a faster Find Duplicates Routine
- Subject: Re: Need a faster Find Duplicates Routine
- From: Gary Lists <email@hidden>
- Date: Tue, 27 May 2003 21:44:13 -0400
On or about 5/27/03 2:58 PM, Johnny AppleScript wrote:
>
Hey All,
>
>
Anyone know of any samples that will run faster than this? This one is fine
>
for under 300 items, but give it 3000 (3k X 3k = painfully inefficient), and
>
be prepared to wait... and wait... and wait...
>
>
set theItems to [a list of items]
>
set dupesList to {}
>
set checkList to {}
>
repeat with i from 1 to number of items in theItems
>
set x to the name of item i of theItems
>
if x is in checkList then
>
repeat with i from 1 to number of items in theItems
>
set y to item i of theItems
>
if the name of y is x then
>
set the end of dupesList to y
>
end if
>
end repeat
>
else
>
copy x to the end of checkList
>
end if
>
end repeat
>
>
TIA
>
>
JA
"Johnny AppleScript" (very funny),
I read with interest Paul Skinner's handlers posted in reply. That was slow
read for me...but the handlers are quite swell. (Thanks, Paul S.)
Recently in a search for some list handling tools, I returned to the Wild
Blue Yonder of the 'has' pages and got the fastListLib file, which shows the
best list-time-improving feature / bug / exploit ever.
Rather than rewrite, you can find out more about improving the speed of your
handler (which may not be as powerful as the Paul S. handlers but certainly
is much more manageable if you're no pro ... i.e. "me")
The 'has' Little Page of AppleScript is here:
<
http://www.barple.pwp.blueyonder.co.uk/>
and the 'Rough Stuff' page has the fastListLib, here:
<
http://www.barple.pwp.blueyonder.co.uk/roughstuff/index.html>
I found it to be a great starter library for list management (and uses the
massive speed gain trick) and a valuable learning resource even if one
doesn't link/compile the library into one's scripts. (Although, thanks to
has'es (?) ASLoad() library, I am linking my own library into my own
scripts with ease and confidence, giving me access to handlers of mine that
I use all the time....like makeISOdate() and writeToFile() and the like.)
HTH some,
--
Gary
Incoming replies are auto-deleted.
Please post directly to the list or newsgroup.
_______________________________________________
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.