http://www.perlmonks.org?node_id=629877


in reply to Re: Nested evals - are they evil? (sample benchmarks)
in thread Nested evals - are they evil?

I would expect eval to be a little slower, but not that much. Maybe this is because of the extra scope you're adding here. Try changing the no_eval_code to this, to see if the extra scoping is free or not:
sub no_eval_code { for (reverse 0..9) { if ($_==0) { error_sub(); } else { { my $x = 100/$_; } } } }

Replies are listed 'Best First'.
Re^3: Nested evals - are they evil? (sample benchmarks)
by cLive ;-) (Prior) on Jul 31, 2007 at 17:57 UTC
    heh
    Rate eval noeval eval 88768/s -- -39% noeval 146161/s 65% --