Directory munging [was: Re: Phoenix.pm: Three snippets]

Eden Li eden.li at asu.edu
Sun May 6 04:59:11 CDT 2001


Yes, quite a big one actually:

perl -MBenchmark -e "timethese (10000, {'map' => sub { map
{$n=$_}(0..10000) }, 'for' => sub { for (0..10000) {$n=$_}}})"

Benchmark: timing 10000 iterations of for, map...
       for: 44 wallclock secs (42.42 usr +  0.00 sys = 42.42 CPU) @ 235.73/s
(n=
10000)
       map: 97 wallclock secs (91.34 usr +  0.01 sys = 91.35 CPU) @ 109.47/s
(n=
10000)

Also, as I mentioned before... it's just the wrong construct
for plain ol' looping.

Eden

From: "Tran Forsythe" <forsythe at primenet.com>
> Hmm.. why is that?  A performance hit?





More information about the Phoenix-pm mailing list