home *** CD-ROM | disk | FTP | other *** search
- Path: convex!bcm!cs.utexas.edu!sun-barr!cronkite.Central.Sun.COM!jethro!exodus!joe.Eng.Sun.COM!petolino
- From: petolino@joe.Eng.Sun.COM (Joe Petolino)
- Newsgroups: comp.lang.perl
- Subject: Re: perl profiler?
- Message-ID: <18678@exodus.Eng.Sun.COM>
- Date: 20 Aug 1991 01:23:56 GMT
- References: <7898@male.EBay.Sun.COM> <18507@exodus.Eng.Sun.COM>
- Sender: news@exodus.Eng.Sun.COM
- Organization: Sun Microsystems, Mt. View, Ca.
- Lines: 536
-
- In response to several e-mail inquiries, and by permission of the author,
- I'm posting Ray Lischner's profiler. Things to look out for: the decription
- in the mail uses different names for things than the code does (e.g.
- &DB'perlprof is really &DB'profile). It doesn't work in old versions of
- perl. I had better luck using the PERLDB environment variable (as Camel
- book suggests) rather than 'perl -I' .
-
- -Joe
-
- ----- Begin Forwarded Message -----
-
- >From lisch@sysserver1.mentor.com Mon Aug 12 15:43:00 1991
- Date: Mon, 12 Aug 91 15:44:11 PDT
- From: Ray Lischner <lisch@sysserver1.mentor.com>
- To: petolino@joe.Eng.Sun.COM (Joe Petolino)
- Subject: perl profiler?
-
- >>>>> On 11 Aug 91 22:24:00 GMT, petolino@joe.Eng.Sun.COM (Joe Petolino) said:
- Joe> (Apologies if this has been discussed before)
- Joe> The camel book suggests modifying perldb.pl to implement a profiler. Has
- Joe> anyone done this? Is it available for general use?
-
- I tried to work on one, but it isn't very pretty. I tried to make it
- work with a new switch to perl, -m, but I gave up because it wasn't clear
- to me where Perl exits the program. Instead, make sure your script has
- the line:
-
- &DB'perlprof if defined &DB'perlprof;
-
- where the script exists, e.g., at the end.
-
- I invoke the script as follows:
-
- perl -I/dir/where/the/perlprof/perldb.pl/lives -d script ...
-
- The file "perlmon.out" is created in the working directory that is current
- when the script exits, so watch out for chdir()s in the script.
-
- Then run pprof to get a pretty listing of the information.
-
- I'm not sure what to do with evals, and the measurements add a lot of
- overhead, but the information can still be useful. I have successfully
- used the information to locate bottlenecks. Good luck.
-
- Ray Lischner
-
-
-