Re: quicksorts [Re: List sorting dilemma]
Re: quicksorts [Re: List sorting dilemma]
- Subject: Re: quicksorts [Re: List sorting dilemma]
- From: "Serge Belleudy-d'Espinose" <email@hidden>
- Date: Sat, 27 Jul 2002 12:52:15 +0200
Hi all,
I've been mostly away but never totally off, and when you say the
magic words I can come back (I don't know who coined the 'Serge
technique' expression but I feel the greatest gratitude everytime
this technique or my name are mentioned...)
Ok, I spent a few hours comparing the codes from has and Arthur to
mine. First, let me say that my code will always be slower: the
quickSort mod is intended to have a rich feature set so there will
always be a somewhat noticeable overhead when values are checked and
passed all around. This slowness is a design decision :) However this
is all a matter of ticks, not seconds.
So I trimed my quickSort to the very core and the results are
amazing. It seems Arthur is the winner but the situation is complex.
The respective performances depend on the test list. Here are my
results; each sample expresses the average time for each (Jon's
ticks) plus the % gain of speed of has vs mine and Arthur vs mine. I
didn't test Emmanuel's revised code since I suspect the results will
be very close. Average of ten tests.
1.000 unique ordered items:
SBE: 86
has: 75 -> 12%
Arthur J. Knapp: 54 -> 37%
1.000 unique reverse ordered items:
SBE: 86
has: 74 -> 13%
Arthur J. Knapp: 60 -> 29%
1.000 random items (random doesn't necessarily mean unique...):
SBE: 102
has: 104 -> -1%
Arthur J. Knapp: 114 -> -11%
1.000 random items out of 500:
SBE: 115
has: 100 -> 12%
Arthur J. Knapp: 111 -> 3%
etc.
The fun stuff is that even with the averaging, results can vary from
one serie of tests to another. The random generator must be tired
sometimes...
Serge
--
\\//\//\// Serge Belleudy-d'Espinose Institut Jacques Monod - Jussieu
// // //
http://www.ijm.jussieu.fr/ Universites Paris VI, VII & CNRS
//\//\//\\
_______________________________________________
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.