13 Aug 1998 09:53:00 UTC
- Distribution: DevelOpProf
- Module version: 0.1
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (1)
- Testers (3 / 11 / 0)
- KwaliteeBus factor: 0
- % Coverage
- License: unknown
- Activity24 month
- Download (2.57KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Devel::OpProf - Profile the internals of a Perl program
use Devel::OpProf qw(profile print_stats); ... profile(1); # turn on profiling ... # code to be profiled profile(0); # turn off profiling ... print_stats; # print out operator statistics
This module lets perl keep a count of each internal operation in a program so that you can profile your Perl code. The following functions are exported.
Turns profiling on if FLAG is non-zero, off if FLAG is zero. The operator profile counts are only incremented whilst profiling is on.
Returns a reference to a hash containing the current profile counts. Each key in the hash is an operator description (e.g. "constant item", "addition" or "string comparison") and the corresponding value is the associated count.
Prints a formatted, sorted list of all operators with non-zero counts to stdout.
Zeroes the profile counts of all operators.
Returns an array of the raw profiling counts (indexed by opcode). This is mainly for internal use but may be useful for internals hackers: functions in the Opcode module may be helpful here.
Part of the internal operations involved in statements such as
profile(0)affect the profiling counts themselves. This should be unimportant if the code being profiled is non-trivial.
Malcolm Beattie, email@example.com.
Module Install Instructions
To install Devel::OpProf, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Devel::OpProf
For more information on module installation, please visit the detailed CPAN module installation guide.