Actually, if you agree that the following code would be valid for a benchmark, then you might be surprised.

Code:

Results (1_000_000 iterations):

Benchmark: timing 1000000 iterations of map_browseruk, map_browseruk_setup, map_jwkrahn, map_jwkrahn_setup, unpack, unpack_setup... map_browseruk: 16 wallclock secs (14.77 usr + 0.04 sys = 14.81 CPU) @ 67521.94/s (n=1000000) map_browseruk_setup: 9 wallclock secs ( 9.27 usr + 0.03 sys = 9.30 CPU) @ 107526.88/s (n=1000000) map_jwkrahn: 29 wallclock secs (23.17 usr + 0.04 sys = 23.21 CPU) @ 43084.88/s (n=1000000) map_jwkrahn_setup: 23 wallclock secs (20.23 usr + 0.03 sys = 20.26 CPU) @ 49358.34/s (n=1000000) unpack: 4 wallclock secs ( 2.43 usr + 0.00 sys = 2.43 CPU) @ 411522.63/s n=1000000) unpack_setup: 1 wallclock secs ( 0.44 usr + 0.00 sys = 0.44 CPU) @ 2272727.27/s (n=1000000)

I must say I was surprised. I included the times for "setup"-that is, everything but the operation itself, on the idea that perhaps the setup might have taken longer for the one method than another. Thoughts....?

Update (26-Sept-2006): Updated formatting of results.

Update (26-Sept-2006): Fixed typo. (Thanks to BrowserUk for pointing it out.)

Update (26-Sept-2006): Fixed 2nd typo. (Thanks to chargrill for pointing it out.)


In reply to Re^2: Challenge: Construct an unpack string by atcroft
in thread Challenge: Construct an unpack string by holli

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.