it is much faster to instead use a sort subroutine set up to return a reversed sort, i.e.for(reverse sort @foo)
$b <=> $a instead of $a <=> $b returns reversed list...for(sort {$b <=> $a} @foo)
and use cmp instead of <=>
My benchmars show a SIGNIFICANT difference between the two...
just something I thought I'd share... many people probably realized this already
Update HAHAHAH, I wrote this just before I left, went
home and just read Nathan Torkington's article in TPJ #20
about arrays, which says the same thing I do here... That's
funny in my book.
- Ant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reversing a sort...
by arhuman (Vicar) on May 09, 2001 at 11:08 UTC | |
|
Re: reversing a sort...
by ChemBoy (Priest) on May 09, 2001 at 01:32 UTC | |
|
Re: reversing a sort...
by DrZaius (Monk) on May 09, 2001 at 01:45 UTC | |
by chipmunk (Parson) on May 09, 2001 at 02:01 UTC | |
by tilly (Archbishop) on May 09, 2001 at 03:39 UTC | |
by chipmunk (Parson) on May 09, 2001 at 05:22 UTC | |
by nardo (Friar) on May 09, 2001 at 02:49 UTC | |
by chipmunk (Parson) on May 09, 2001 at 05:09 UTC | |
by tilly (Archbishop) on May 09, 2001 at 05:23 UTC |