Ooh, I like it! ++ and then some!

I had to install Sort::Key to give it a whirl, and I can't manage to get the same 92% number, but I still like it just fine. Here's what I get, best of three, with ST and GRT thrown into the mix:

@address populated Benchmark: running gloryhackish, grt, ks, schwartzian, uks for at leas +t 30 CPU seconds... gloryhackish: 34 wallclock secs (33.28 usr + 0.19 sys = 33.47 CPU) @ + 0.12/s (n=4) grt: 34 wallclock secs (34.62 usr + 0.06 sys = 34.68 CPU) @ 0 +.12/s (n=4) ks: 34 wallclock secs (34.04 usr + 0.03 sys = 34.07 CPU) @ 0 +.18/s (n=6) schwartzian: 55 wallclock secs (54.62 usr + 0.11 sys = 54.73 CPU) @ +0.04/s (n=2) (warning: too few iterations for a reliable count) uks: 36 wallclock secs (35.53 usr + 0.24 sys = 35.77 CPU) @ 0 +.17/s (n=6) s/iter schwartzian grt gloryhackish uks + ks schwartzian 27.4 -- -68% -69% -78% + -79% grt 8.67 216% -- -3% -31% + -35% gloryhackish 8.37 227% 4% -- -29% + -32% ukeysort 5.96 359% 45% 40% -- + -5% keysort 5.68 382% 53% 47% 5% + --

Still, even at 47% I'm suitably impressed and will be using keysort. It strikes me as odd that in your results keysort was bested by ukeysort... hardware differences, perhaps? (Mine's an AMD64 X2 4400+ w/2G DDR2 RAM.)

Thanks for pointing Sort::Key out to me!

Edit: Running on my original list of 11818 addresses, gloryhackish comes in 31% faster than ukeysort but 47% slower than keysort. Hmmmm.... curious, but still convincing.


In reply to Re^2: Sorting IP addresses, lots of them, quickly by gloryhack
in thread Sorting IP addresses, lots of them, quickly by gloryhack

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.