in reply to Benchmarking for loops?
Looking at the output of B::Concise, there are two extra opcodes in the block version. Compare:
$ perl -MO=Concise -e 'my $total = 0; $total += $_ for(1..1e6);'to:
$ perl -MO=Concise -e 'my $total = 0; for(1..1e6){$total += $_;}'At first glance, it looks like the opcodes manage entering and exiting the block scope.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Benchmarking for loops?
by Fletch (Bishop) on Jul 13, 2004 at 00:10 UTC | |
|
Re^2: Benchmarking for loops?
by ysth (Canon) on Jul 13, 2004 at 00:33 UTC | |
by chromatic (Archbishop) on Jul 13, 2004 at 05:48 UTC | |
by ysth (Canon) on Jul 13, 2004 at 06:18 UTC | |
by stvn (Monsignor) on Jul 13, 2004 at 03:02 UTC | |
by ysth (Canon) on Jul 13, 2004 at 06:28 UTC |