in reply to Re^11: "Automated" benchmarking
in thread "Automated" benchmarking
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;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^13: "Automated" benchmarking
by BrowserUk (Patriarch) on Jan 25, 2012 at 17:04 UTC | |
by salva (Canon) on Jan 25, 2012 at 17:40 UTC | |
by BrowserUk (Patriarch) on Jan 25, 2012 at 20:12 UTC | |
by salva (Canon) on Jan 26, 2012 at 09:04 UTC | |
by BrowserUk (Patriarch) on Jan 26, 2012 at 10:04 UTC |
In Section
Seekers of Perl Wisdom