Re: Sorting handler (Caution! may contain hexa)
Re: Sorting handler (Caution! may contain hexa)
- Subject: Re: Sorting handler (Caution! may contain hexa)
- From: Emmanuel <email@hidden>
- Date: Wed, 26 Sep 2001 16:41:48 +0200
(Warning: this message contains hexa. People who have already in the past
observed troubles reading hexa may want to skip this message.)
At 11:46 +0200 26/09/01, Serge Belleudy-d'Espinose wrote:
>
I've just completed a brute force quick sort handler, and I am amazed at
>
how fast it can be compared to anything else. Did anyone else work on more
>
or less the same thing?
At the time of the previous thread on this topic, we have developped a
still faster (plain AppleScript) sort algorithm, specifically for
AppleScript.
"specifically for AppleScript" means that the algorithm takes into account
the particular way AS accesses lists with respect to other programming
languages (details: lists can contain elements of various sizes, so to
access 'item n' AS has really to perform n accesses, whereas in usual
programming language 'item n' is really one access).
Our new 'sort' is faster than all algorithms we know, and furthermore it is
more independent on the order of the input list.
I post it below as hexa. Listees interested in a directly usable script can
ask me privately of course. (I'll send them the 'Hexa to string' script :-)
6F6E20517569636B536F7274286C290D09736574206E20746F206C656E677468206F66206C0D0969
66206E20B22031207468656E2072657475726E206C0D09736574206D20746F206E2064697620320D
09736574207820746F20636F6E74656E7473206F66206974656D206D206F66206C0D09736574206C
3120746F207B7D0D09736574206C3220746F207B7D0D09726570656174207769746820692066726F
6D203120746F206D202D20310D0909736574207920746F20636F6E74656E7473206F66206974656D
2069206F66206C0D090969662078203C2079207468656E0D090909736574206C3220746F206C3220
2620790D0909656C73650D090909736574206C3120746F206C31202620790D0909656E642069660D
09656E64207265706561740D09726570656174207769746820692066726F6D206D202B203120746F
206E0D0909736574207920746F20636F6E74656E7473206F66206974656D2069206F66206C0D0909
69662078203C2079207468656E0D090909736574206C3220746F206C32202620790D0909656C7365
0D090909736574206C3120746F206C31202620790D0909656E642069660D09656E64207265706561
740D096966206C656E677468206F66206C31203E2031207468656E20736574206C3120746F205175
69636B536F7274286C31290D096966206C656E677468206F66206C32203E2031207468656E207365
74206C3220746F20517569636B536F7274286C32290D0972657475726E206C31202620782026206C
320D656E6420517569636B536F72740D0D6F6E204644536F7274287468654C697374290D09736574
206E20746F2028636F756E74207468654C697374290D096966206E203D2031207468656E20726574
75726E207468654C6973740D096966206E203D2032207468656E0D0909736574207B782C20797D20
746F207468654C6973740D090969662078203C2079207468656E2072657475726E207468654C6973
740D090972657475726E207B792C20787D0D09656E642069660D096966206E203C20323020746865
6E2072657475726E20517569636B536F7274287468654C697374290D09736574206C20746F207B7D
0D09736574206C6620746F207B7D0D09736574207468654C6973743120746F204644536F72742869
74656D732031207468727520286E20646976203229206F66207468654C697374290D097365742074
68654C6973743220746F204644536F7274286974656D73202831202B20286E206469762032292920
74687275202D31206F66207468654C697374290D0973657420783120746F20636F6E74656E747320
6F66206974656D2031206F66207468654C697374310D0973657420783220746F20636F6E74656E74
73206F66206974656D2031206F66207468654C697374320D096966206E203E203830207468656E20
736574206E20746F2028726F756E64202832202A20287371727420286E292929290D097472790D09
097265706561740D090909726570656174206E2074696D65730D09090909696620287831203C2078
3229207468656E0D090909090973657420656E64206F66206C20746F2078310D0909090909736574
207468654C6973743120746F2072657374206F66207468654C697374310D09090909097365742078
3120746F20636F6E74656E7473206F66206974656D2031206F66207468654C697374310D09090909
656C73650D090909090973657420656E64206F66206C20746F2078320D0909090909736574207468
654C6973743220746F2072657374206F66207468654C697374320D09090909097365742078322074
6F20636F6E74656E7473206F66206974656D2031206F66207468654C697374320D09090909656E64
2069660D090909656E64207265706561740D090909736574206C6620746F206C662026206C0D0909
09736574206C20746F207B7D0D0909656E64207265706561740D096F6E206572726F720D09097365
74206C6620746F206C662026206C2026207468654C697374312026207468654C697374320D09656E
64207472790D0972657475726E206C660D656E64204644536F72740D0D6F6E20736F7274286C290D
094644536F7274286C290D656E6420736F72740D
Best regards,
Emmanuel