I'd like to see any Benchmark that could show that using that technique you describe could provide measurable performance gains.

#! perl -w use strict; use Benchmark qw(cmpthese); sub parent { return ++$_[$#_]; # minimal use of entire passed array. } sub child1 { my ($self, @rest) = @_; return parent(@rest); } sub child2 { my $self = shift; goto &parent; } print 'child1: ', child1( "fred", 1..1000 ), $/; print 'child2: ', child2( "bill", 1..1000 ), $/; cmpthese( 10000, { noShiftOrGoto => sub { child1( "fred", 1..1000 ); }, shiftAndGoto => sub { child2( "bill", 1..1000 ); }, }); __DATA__ C:\test>196823 child1: 1001 child2: 1001 Benchmark: timing 10000 iterations of noShiftOrGoto, shiftAndGoto... noShiftOrGoto: 33 wallclock secs (32.33 usr + 0.00 sys = 32.33 CPU) @ + 309.35/s (n=10000) shiftAndGoto: 6 wallclock secs ( 5.85 usr + 0.00 sys = 5.85 CPU) @ +1709.69/s (n=10000) Rate noShiftOrGoto shiftAndGoto noShiftOrGoto 309/s -- -82% shiftAndGoto 1710/s 453% -- C:\test>

Well It's better than the Abottoire, but Yorkshire!

In reply to Re: Re^8: How about 450% greater performance by BrowserUk
in thread stoping and restarting a loop by mnlight

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.