Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: DProf-ing A Dist

by xdg (Monsignor)
on Aug 19, 2005 at 19:06 UTC ( #485274=note: print w/replies, xml ) Need Help??


in reply to DProf-ing A Dist

The general idea is that you want to identify where your program spends most of its time and focus your optimization efforts there. (E.g., subroutines that are frequently called or that take a long time to execute.) This is what Devel::DProf (and the dprofpp program) does for you.

Once you've identified those areas, you want to find out whether there are things in those sections that can be recoded to take less time. (E.g. something that is computed inside a loop the same way every time should be computed once before the loop starts).

The Wikipedia has an entry on Optimization that might get you started. You might also want to pick up a copy of Jon Bentley's Programming Pearls, which (while not Perl specific, despite the title) has a lot of good insights.

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://485274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2022-05-20 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (73 votes). Check out past polls.

    Notices?