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.
In reply to Re: Yet Another Sort Benchmarking Question
by dave_the_m
in thread Yet Another Sort Benchmarking Question
by tlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |