If I add a couple of tests where, instead of messing with globals you use lexical variables (just stick a 'my' at the front of each sub), I get the following results from a cmpthese(-10,{...}) run. I've combined the two sizes of test, hopefully the table is self explanatory.
              Rate $ 1000 @ 1000 my $ 1000 my @ 1000 my @ 5    @ 5 my $ 5    $ 5
$ 1000      1192/s     --   -15%      -15%      -22%   -99%   -99%  -100%  -100%
@ 1000      1399/s    17%     --       -1%       -8%   -99%   -99%  -100%  -100%
my $ 1000   1408/s    18%     1%        --       -8%   -99%   -99%  -100%  -100%
my @ 1000   1528/s    28%     9%        8%        --   -99%   -99%  -100%  -100%
my @ 5    126214/s 10492%  8921%     8861%     8162%     --   -34%   -60%   -63%
@ 5       191633/s 15981% 13596%    13506%    12445%    52%     --   -40%   -44%
my $ 5    317943/s 26581% 22624%    22474%    20713%   152%    66%     --    -7%
$ 5       341012/s 28517% 24273%    24111%    22224%   170%    78%     7%     --
Hmm... I do like the way the 1000s are almost the reverse of the 5s. Life's too short to go generating a graph to find out where the crossover points are, but it's certainly odd...

In reply to Re: Re: list of scalars vs arrays, speed? by pdcawley
in thread list of scalars vs arrays, speed? by BUU

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.