Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have added an entry for Sort::Key to Pustular Postulant benchmarks
use Sort::Key; sub mykeysort { ikeysort { /foo(\d+)\.tla/; $1 } @_ }
and those are the results for 200 elements:
Rate naive schwartzian guttros Sort::Key naive 17.9/s -- -73% -79% -83% schwartzian 67.1/s 276% -- -20% -36% guttros 84.0/s 371% 25% -- -19% Sort::Key 104/s 483% 55% 24% --

for 5000 elements:

Rate naive schwartzian guttros Sort::Key naive 0.413/s -- -77% -86% -89% schwartzian 1.79/s 334% -- -38% -52% guttros 2.88/s 597% 61% -- -23% Sort::Key 3.74/s 805% 109% 30% --

for 50000 elements

s/iter naive schwartzian guttros Sort::Key naive 30.2 -- -78% -87% -90% schwartzian 6.53 363% -- -42% -56% guttros 3.81 693% 72% -- -24% Sort::Key 2.90 942% 125% 31% --

and for 500000 elements

s/iter guttros Sort::Key guttros 39.6 -- -25% Sort::Key 29.7 33% --

so Sort::Key is consistently ~30% faster than guttros ;-)


In reply to Re^2: Choosing the right sort (Or: WUDsamatter?) by salva
in thread Choosing the right sort (Or: WUDsamatter?) by friedo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-16 15:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found