in reply to Re^2: Unhappy returns
in thread Unhappy returns
use Benchmark; timethese(1000, { 'map1' => sub { my %str = map {($_,1)} (0..1024); }, 'arry' => sub { my %str = (); @str{0..1024} = (1)x1025; } }); Benchmark: timing 1000 iterations of arry, map1... arry: 1 wallclock secs ( 1.36 usr + 0.00 sys = 1.36 CPU) @ 73 +5.29/s (n=1000) map1: 3 wallclock secs ( 3.11 usr + 0.00 sys = 3.11 CPU) @ 32 +1.54/s (n=1000)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Unhappy returns
by dragonchild (Archbishop) on Oct 10, 2005 at 17:32 UTC | |
|
Re^4: Unhappy returns
by Perl Mouse (Chaplain) on Oct 10, 2005 at 16:00 UTC |