in reply to Yet Another Sort Benchmarking Question
I'm having a hard time rationalizing why <=> did so much better than the default alphabetic sort, since it was my understanding that the latter should be betterI don't know what gave you that idea. Its a lot quicker at the hardware level to compare two integers than two strings.
As an aside, note that perl specifically optimizes {$a cmp $b} and {$a <=> $b}, and doesn't actually call the perl code for each pair comparison
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Yet Another Sort Benchmarking Question
by tlm (Prior) on May 08, 2005 at 14:28 UTC | |
by dave_the_m (Monsignor) on May 08, 2005 at 15:16 UTC | |
by tilly (Archbishop) on May 08, 2005 at 19:43 UTC |