in reply to Re^2: Howto Avoid Memory Problem in List::MoreUtils
in thread Howto Avoid Memory Problem in List::MoreUtils
And if the quicksort algorithm is selected, then the sentence on my previous post becomes really true:use Memchmark 'cmpthese'; # use sort '_quicksort'; cmpthese( none => sub { my @a = map { int rand 100 } 1..1000000; }, sort0 => sub { my @a = map { int rand 100 } 1..1000000; @a = + sort { $a <=> $b } @a }, sort1 => sub { my @a = map { int rand 100 } 1..1000000; @a = + sort { $a <=> $b } @a, 1 } ); __END__ test: none, memory used: 3997696 bytes test: sort0, memory used: 7999488 bytes test: sort1, memory used: 12390400 bytes
use sort '_quicksort'; ... __END__ test: none, memory used: 3997696 bytes test: sort0, memory used: 3997696 bytes test: sort1, memory used: 12390400 bytes
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Howto Avoid Memory Problem in List::MoreUtils
by BrowserUk (Patriarch) on May 04, 2006 at 11:48 UTC | |
by salva (Canon) on May 04, 2006 at 12:13 UTC | |
by BrowserUk (Patriarch) on May 04, 2006 at 12:30 UTC | |
by salva (Canon) on May 04, 2006 at 13:18 UTC | |
by BrowserUk (Patriarch) on May 04, 2006 at 13:42 UTC | |
|