home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / perl / scripts-convex / profiling / perldb.doc~ < prev    next >
Encoding:
Text File  |  1993-07-14  |  1.3 KB  |  39 lines

  1. ----- Begin Forwarded Message -----
  2.  
  3. >From lisch@sysserver1.mentor.com Mon Aug 12 15:43:00 1991
  4. Date: Mon, 12 Aug 91 15:44:11 PDT
  5. From: Ray Lischner <lisch@sysserver1.mentor.com>
  6. To: petolino@joe.Eng.Sun.COM (Joe Petolino)
  7. Subject: perl profiler?
  8.  
  9. >>>>> On 11 Aug 91 22:24:00 GMT, petolino@joe.Eng.Sun.COM (Joe Petolino) said:
  10. Joe> (Apologies if this has been discussed before)
  11. Joe> The camel book suggests modifying perldb.pl to implement a profiler.  Has
  12. Joe> anyone done this?  Is it available for general use?
  13.  
  14. I tried to work on one, but it isn't very pretty.  I tried to make it
  15. work with a new switch to perl, -m, but I gave up because it wasn't clear
  16. to me where Perl exits the program.  Instead, make sure your script has
  17. the line:
  18.  
  19.     &DB'perlprof if defined &DB'perlprof;
  20.  
  21. where the script exists, e.g., at the end.
  22.  
  23. I invoke the script as follows:
  24.  
  25.     perl -I/dir/where/the/perlprof/perldb.pl/lives -d script ...
  26.  
  27. The file "perlmon.out" is created in the working directory that is current
  28. when the script exits, so watch out for chdir()s in the script.
  29.  
  30. Then run pprof to get a pretty listing of the information.
  31.  
  32. I'm not sure what to do with evals, and the measurements add a lot of
  33. overhead, but the information can still be useful.  I have successfully
  34. used the information to locate bottlenecks.  Good luck.
  35.  
  36. Ray Lischner
  37.  
  38.  
  39.