[comp.lang.perl] profiling Perl

lisch@mentor.com (Ray Lischner) (11/08/90)

I am looking at how to get profiling information for Perl scripts,
and I think I have most of it written.  The biggest problem left
is how to get all the information written at the end of execution.

I was thinking that the general, all-purpose approach would be
to add atexit(SUBR) as a builtin operation, so that the subroutine
SUBR is called when die or exit is evaluated at the top level,
or when the end of the script is reached.  The subroutines would
be called in first-in-first-called order.

BTW, the current approach I am taking is to have a new perldb.pl
that sets trace mode and calls time and times in DB'DB.  It also
keeps keeps track of per-subroutine times in DB'sub.  This is
a lot of overhead, though (75% of the CPU time for a small script).

Any advice or better ideas?
-- 
Ray Lischner        UUCP: {uunet,apollo,decwrl}!mntgfx!lisch