Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Profiling Perl > Devel::DProf

Devel::DProf

I started this chapter with Devel::SmallProf only because I get to the results faster. Devel::DProf does much of the same thing, but stores the results in its own format so it can do several things with them later, such as make pretty code graphs. I call it in the same way by using the -d switch.

I have a program that reads the Use.Perl[25]journal entries through its SOAP interface. I run it with the -d switch and tell it to use Devel::DProf as the debugging module:

% perl -d:DProf journals

Once I’ve run the program, I have a new file named tmon.out, although I can change that with the PERL_DPROF_OUT_FILE_NAME environment variable. This file isn’t human-readable, so I need to use dprofpp to turn it into something that I can use. The wallclock time is 53 seconds, although I spent less than a second in the CPU. I could improve parts of the program, but the network latency and download times will still dominate the time:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint