[EMAIL PROTECTED] wrote on 29/07/2004 09:31:24 AM:

> Hi Sluggers:
> 
> Is there a way for me to analyse Perl performance to see which portion
> takes the most CPU usage ?
> 
> The url
> 
> http://www.ccl4.org/~nick/P/Fast_Enough/
> 
> talks about a Devel::DProf (with Devel::DProfPP to decode) to check 
speed.
> What I want is to see portion of code that takes up the most CPU usage
> that I see from running "top".
> 

I don't understand what you mean, "top" shows you what process is taking 
most of the CPU time, not which piece of code is.

The above url you mentioned looks like it will give you what you want.
The time is not actually seconds taken from execution to completion 
(Although it looks like it has that as well) it is cpu time it has taken 
to execute.
Look at the following command:

[EMAIL PROTECTED] scott]$ time sleep 2

real    0m2.011s
user    0m0.000s
sys     0m0.010s

Notice Real took just over 2 seconds, thats because it slept it didn't use 
any cpu cycles to sleep, but .010 seconds on sys, which states it took 
.010 seconds of the cpu time to execute.
I believe the cpu time is user + sys time. real is the actual time it took 
to run from execute to completion.

Hope this helps.

Cheers,

Scott

> For scripts that runs via browser how do I check such performace 
criteria ?
> 
> Do I add this in the top line of the .pl script ?
> 
> #!/usr/bin/perl -d:DProf
> 
> I read the Dprofpp options, and I cannot see a switch that tells me the
> CPU usage for each sub routine. This seems to work with speed only.
> 
> Is there another module for CPU usage instead of time in secs ?
> 
> Thanks.
> 
> Louis.
> 
> -- 
> I'm always learning something new everyday. Thanks Sluggers.
> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to