Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Could this be a benefit of using a multicore system?

Yes, that may be or that I have hyper threading activated on my desktop machine.

For the last line eee() for 1 .. 5;, the count is two but ought be one

You get that numbers because both Devel::SmallProf and Devel::NYTProf are not counting lines but "sentences" executed

It also seems that the meaning of "sentence" changes between perl versions. Under 5.8, I get similar results to the ones you have posted. Under 5.14, I get different ones:

count wall tm cpu time line 0 0.00000 0.00000 1:#! perl -slw 0 0.00000 0.00000 2:use strict; 0 0.00000 0.00000 3:use Time::HiRes qw[ time ]; 0 0.00000 0.00000 4: 0 0.00000 0.00000 5:sub aaa { 5000 5.83176 0.17000 6: Time::HiRes::nanosleep( 1_000_ +000 ); 0 0.00000 0.00000 7:} 0 0.00000 0.00000 8: 0 0.00000 0.00000 9:sub bbb { 500 5.27816 0.00000 10: Time::HiRes::nanosleep( 10_000 +_000 ); 0 0.00000 0.00000 11:} 0 0.00000 0.00000 12: 0 0.00000 0.00000 13:sub ccc { 50 5.01925 0.00000 14: Time::HiRes::nanosleep( 100_00 +0_000 ); 0 0.00000 0.00000 15:} 0 0.00000 0.00000 16: 0 0.00000 0.00000 17:sub ddd { 5 5.00106 0.00000 18: Time::HiRes::nanosleep( 1_000_ +000_000 ); 0 0.00000 0.00000 19:} 0 0.00000 0.00000 20: 0 0.00000 0.00000 21:sub eee { 0 0.00000 0.00000 22: aaa() 5 0.00001 0.00000 23: for 1 .. 1000; 0 0.00000 0.00000 24: bbb() 5 0.00001 0.00000 25: for 1 .. 100; 0 0.00000 0.00000 26: ccc() 5 0.00001 0.00000 27: for 1 .. 10; 0 0.00000 0.00000 28: ddd() 5 0.00001 0.00000 29: for 1 .. 1; 0 0.00000 0.00000 30:} 0 0.00000 0.00000 31: 1 0.00001 0.00000 32:eee for 1..5;

In reply to Re^12: "Automated" benchmarking by salva
in thread "Automated" benchmarking by DreamT

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others making s'mores by the fire in the courtyard of the Monastery: (15)
    As of 2014-07-31 13:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (248 votes), past polls