I ran this on my machine -- a Dell Precision 340 running Fedora 2.6.something, Perl 5.8.4 --, fixing the arg(s)less problems and giving it a more hefty list to sort (~2500 items). My results from three runs:
Rate proto argsless inline args proto 189740/s -- -0% -31% -32% argsless 190421/s 0% -- -30% -32% inline 273132/s 44% 43% -- -3% args 280139/s 48% 47% 3% -- Rate argsless proto inline args argsless 188543/s -- -0% -31% -33% proto 188746/s 0% -- -31% -33% inline 273988/s 45% 45% -- -3% args 281040/s 49% 49% 3% -- Rate proto argsless inline args proto 191010/s -- -1% -27% -30% argsless 192801/s 1% -- -27% -30% inline 262320/s 37% 36% -- -4% args 274019/s 43% 42% 4% --
I'm not terribly surprised that inline is faster than the other named sub methods, but am quite surprsied that the 'args' version is the fastest.

Update: Okay, adding an assignment in the benchmarked code gives more sensible results:

Rate args proto argsless inline args 17.5/s -- -45% -49% -51% proto 31.8/s 82% -- -8% -11% argsless 34.6/s 98% 9% -- -3% inline 35.5/s 103% 12% 3% -- Rate args proto argsless inline args 17.3/s -- -46% -51% -52% proto 32.0/s 85% -- -9% -11% argsless 35.1/s 103% 10% -- -2% inline 35.7/s 107% 12% 2% -- Rate args proto inline argsless args 17.4/s -- -47% -49% -50% proto 33.0/s 90% -- -4% -5% inline 34.4/s 97% 4% -- -1% argsless 34.8/s 100% 5% 1% --
--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."


In reply to Re^3: sort routines crossing package lines by DrWhy
in thread sort routines crossing package lines by DrWhy

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.