in reply to Trouble profiling database script

The Devel::DProf segfault problem is known:

=head1 BUGS Builtin functions cannot be measured by Devel::DProf. With a newer Perl DProf relies on the fact that the numeric slot of $DB::sub contains an address of a subroutine. Excessive manipulation of this variable may overwrite this slot, as in $DB::sub = 'current_sub'; ... $addr = $DB::sub + 0; will set this numeric slot to numeric value of the string C<current_sub>, i.e., to C<0>. This will cause a segfault on the exit from this subroutine. Note that the first assignment above does not change the numeric slot (it will I<mark> it as invalid, but will not write over it).

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: Trouble profiling database script
by cyberconte (Scribe) on Apr 11, 2002 at 12:57 UTC
    i'm almost surpised i havn't found a script that just take another script and adds a couple global variables, inserts Benchmarks at the beginning and end of all subs, and prints out the results of that. It would be rude and crude, but would seem fairly practical, and do profiling w/o relying on anything low-level.

    Of course i could be wrong, in that either it does exist, or it wouldn't be practical....