in reply to Re: Efficiently sorting array by non-alpha strings
in thread Efficiently sorting array by non-alpha strings
L~R,
I had not considered the secondary sort by title. Nice touch!
I added your example into my benchmark tests which now include my original hack, Abigail's bucketsort example and yours (which looks to me like a Schwarztian Transform, no?). Yours takes the cake:
Benchmark: timing 500000 iterations of bucketsort, sort, st... bucketsort: 1 wallclock secs ( 1.73 usr + 0.00 sys = 1.73 CPU) @ 28 +9017.34/s (n=500000) sort: 1 wallclock secs ( 0.90 usr + 0.00 sys = 0.90 CPU) @ 55 +5555.56/s (n=500000) st: 0 wallclock secs ( 0.66 usr + 0.00 sys = 0.66 CPU) @ 75 +7575.76/s (n=500000) Rate bucketsort sort st bucketsort 289017/s -- -48% -62% sort 555556/s 92% -- -27% st 757576/s 162% 36% --
Thanks,
-Wm
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Efficiently sorting array by non-alpha strings
by Limbic~Region (Chancellor) on Feb 20, 2004 at 16:31 UTC | |
by Abigail-II (Bishop) on Feb 20, 2004 at 17:34 UTC |