NAME B::Stats - print optree statistics SYNOPSIS perl -MB::Stats myprog.pl # all perl -MO=Stats myprog.pl # compile-time only perl -MB::Stats[,OPTIONS] myprog.pl DESCRIPTION Print statistics for all generated ops. static analysis at compile-time, static analysis at end-time to include all runtime added modules, and dynamic analysis at run-time, as with a profiler. The purpose is to help you in your goal: no bloat; OPTIONS -c *static* Do static analysis at compile-time. This does not include all run-time require packages. Invocation via -MO=Stats does this automatically. -e *end* Do static analysis at end-time. This is includes all run-time require packages. This calculates the heap space for the optree. -r *run* Do dynamic run-time analysis of all actually visited ops, similar to a profiler. Single ops can be called multiple times. -a *all (default)* Same as -c,-e,-r: static compile-time and end-time and dynamic run-time. -t *table* Tabular list of -c, -e and -r results. -u *summary* Short summary only, no op class. With -t only the final table(s). -F *Files* Prints included file names -x *fragmentation* NOT YET Calculates the optree *fragmentation*. 0.0 is perfect, 1.0 is very bad. A perfect optree has no null ops and every op->next is immediately next to the op. -f *filter* NOT YET Filter for op names and classes. Only calculate the given ops, resp. op class. perl -MB::Stats,-fLOGOP,COP,concat myprog.pl -llogfile NOT YET Print output only to this file. Default: STDERR METHODS compile Static -c check at CHECK time. Triggered by -MO=Stats,-OPTS rcount (opcode) Returns run-time count per op type. output ($count-hash, $ops, $name) General formatter output_runtime -r formatter. Prepares count hash from @runtime array generated in XS and calls output output_table -t formatter