If an XSUB were used to make the conversion ukeysort would be the fastest!

And to show it, I have just uploaded Sort::Key::IPv4 to CPAN ;-)

Now, adding this test to the benchmarks...

use Sort::Key::IPv4 qw(ipv4sort); sub ipv4ks { my @sorted = ipv4sort @address; }
I get for 10_000 addresses:
Rate gloryhackish ukeysort keysort ipv4sor +t gloryhackish 6.14/s -- -31% -54% -79 +% ukeysort 8.91/s 45% -- -34% -70 +% keysort 13.5/s 119% 51% -- -54 +% ipv4sort 29.4/s 378% 229% 118% - +-
For 100_000:
s/iter gloryhackish ukeysort keysort ipv4sor +t gloryhackish 1.80 -- -31% -33% -78 +% ukeysort 1.25 44% -- -3% -68 +% keysort 1.21 49% 3% -- -67 +% ipv4sort 0.400 350% 212% 202% - +-
And for 1_000_000:
s/iter gloryhackish keysort ukeysort ipv4sor +t gloryhackish 24.3 -- -29% -46% -79 +% keysort 17.2 41% -- -24% -71 +% ukeysort 13.2 85% 31% -- -62 +% ipv4sort 4.99 388% 245% 164% - +-

In reply to Re^4: Sorting IP addresses, lots of them, quickly by salva
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.