Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://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":



  • 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 goofing around in the Monastery: (2)
As of 2024-04-26 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found