in reply to Re: Benchmarking the block and list forms of grep
in thread Benchmarking the block and list forms of grep

And thus.. you've benchmarked how much overhead the two operations leave( enter( EXPR ) ) have over just EXPR. Neato.

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

  • Comment on Re^2: Benchmarking the block and list forms of grep

Replies are listed 'Best First'.
Re^3: Benchmarking the block and list forms of grep
by ikegami (Patriarch) on Mar 23, 2006 at 01:01 UTC

    What extra call? q{} gets compiled to a sub, so leave(enter()) was already present.

    Furthermore — and my whole point — the subs now close over lexicals @short, @none and @long, whereas the q{} code used @main::short, @main::none and @main::long, all of which were empty. You could use our @short, etc as an alternative, but when I suggested that in the past, it seemed to confuse people.

    Update: oh! I see the code is not compiled into a sub:

    if (ref $c eq 'CODE') { $subcode = "sub { for (1 .. $n) { local \$_; package $pack; &\$c; +} }"; $subref = eval $subcode; } else { $subcode = "sub { for (1 .. $n) { local \$_; package $pack; $c;} } +"; $subref = _doeval($subcode); }

    You'd think that would be mentioned somewhere prominant in the documentation. I can only find a mention in a footnote on another topic.