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

Re: Debugging script with long exec time

by tlm (Prior)
on Aug 28, 2005 at 19:07 UTC ( [id://487281]=note: print w/replies, xml ) Need Help??


in reply to Debugging script with long exec time

Don't use print for this sort of thing; use a profiler (Devel::Profile, as davidrw mentioned). Profile your program with a relatively small load (i.e. have your program print a small fraction of the map, for example). That should be enough in most cases to tell you where the bottlenecks are, without having to wait for a long run to finish.

the lowliest monk

  • Comment on Re: Debugging script with long exec time

Replies are listed 'Best First'.
Re^2: Debugging script with long exec time
by pg (Canon) on Aug 28, 2005 at 20:57 UTC

    print really has no problem here.

    What would be nice is to have some small scripts to analyze the log files produced. This is one of the area that perl does really good: relatively faster handing large files and has strong regexp support. With Perl it should take one no time to develop such scripts.

    This is the sort of thing I do quite often, and the programs that produce the log files are usually not even in Perl.

    What important is for the log messages to convey useful information. What to log or not to log is the key.

      Many profiling tools are log-analyzers! Take a look at the output from Devel::DProf or Devel::Profiler. The file produced is essentially a specially-formated log-file of subroutine entry and exit times. The dprofpp program is a log-analyzer which reads the log and produces summary reports.

      -sam

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-20 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found