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,
-WmIn reply to Re: Re: Efficiently sorting array by non-alpha strings
by knowmad
in thread Efficiently sorting array by non-alpha strings
by knowmad
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |