Intriguing. Maybe it comes down to the underlying C-runtime code? I just tried it with AS 5.8.0, AS 5.6.1 and 5.8.1 built with Borland, and the results always favour index... They also highlight the penalty of unicode support:(.

P:\test>perl5.8.0 test3.pl8 Rate regex index Abi_regex Abi_index regex 14.6/s -- -10% -14% -21% index 16.3/s 11% -- -4% -13% Abi_regex 17.0/s 16% 4% -- -9% Abi_index 18.6/s 27% 15% 10% -- Okay P:\test>e:\perl5.8.1\bin\perl5.8.1 test3.pl8 Rate regex index Abi_regex Abi_index regex 13.1/s -- -11% -27% -31% index 14.7/s 12% -- -18% -23% Abi_regex 17.9/s 37% 22% -- -6% Abi_index 19.0/s 45% 30% 6% -- Okay P:\test>perl5.6.1 test3.pl8 [snip] Rate regex index Abi_regex Abi_index regex 13.8/s -- -11% -50% -51% index 15.5/s 13% -- -44% -45% Abi_regex 27.6/s 100% 77% -- -3% Abi_index 28.4/s 106% 83% 3% -- Okay

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!
Wanted!


In reply to Re: Re: Re+: Genesis of a sort routine by BrowserUk
in thread Genesis of a sort routine by greenFox

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.