The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Devel::WxProf - heavy-weight subroutine profiler and graphical profile analyzer

SYNOPSIS

    perl -d:WxProf program.pl
    wxprofile tmon.out

    # or if you like it better:
    dprofpp

    # or even
    perl -d:DProf program.pl
    wxprofile tmon.out

DESCRIPTION

Devel::WxProf package is a heavy-weight subroutine profiler for perl.

It collects information on the execution time of a Perl script - more specifically: on the subs called from that script.

To profile a Perl script run the perl interpreter with the -d debugging switch. The profiler uses the debugging hooks. So to profile script test.pl the following command should be used:

    perl -d:WxProf test.pl

When the script terminates the profiler will dump the profile information to a file called wxmon.out.

Use wxprofile to display the information collected.

Devel::WxProf uses the (new) output format of Devel::DProf. You may thus use dprofpp to analyze the data, or analyze data collected using Devel::DProf.

Note that real (wall) time is reported as user time, and system tyme is not reported at all, which means that dprofpp is likely to produce slightly different output for profile data created by Devel::WxProf and Devel::DProf.

Devel::DProf usually reports times at 1/100s granularity, so one-shot data collected by Devel::DProf is likely to be useless (and results largely random).

ENVIRONMENT

PERL_DPROF_OUT_FILE_NAME

Filename to save profile data to, default is tmon.out

BUGS AND LIMITATIONS

Many.

Devel::WxProf measures wall clock times. These may be happily inaccurate - especially if run under a system with heavy load, or a program using interactive dialogs. Wall clock (also called stopwatch) times do not nesseccarily represnt the processing time required to run a program.

Devel::WxProf does not profile anonymous subroutines (yet).

Valid profiling data is not saved until the application terminates and runs this modules END{} block. Applications which cause END{} blocks not to run (such as call _exit or exec) will leave a corrupt and/or incomplete temporary data file.

WxProf reports time in your system's high resolution timer's clock ticks - usually micro- or nanoseconds. The exact times reported by WxProf are badly inaccurate.

If the program being profiled contains subroutines which do not return in a normal manner (such as by throwing an exception), the timing data is estimated and may be attributed incorrectly. The time data might even get corrupted.

WxProf (and wxprofile) are heavy-weight tools. Use with care. You should not try to profile benchmarks with WxProf - try it on single runs instead.

SEE ALSO

    Devel::Profile
    Devel::DProfLB
    Devel::DProf
    dprofpp

DEVELOPEMENT

I wrote Devel::WxProf because I needed a fine-grained one-shot profiler (and because I saw that cool treemap in kcachegrind). I actually wrote it for myself. I'd be pleased if you find it useful, but I probably won't put much time into bugfixes. Send me a test and a patch if you want to speed things up. If you're really out for boosting development, I'll set up a repository I can open up...

LICENSE AND COPYRIGHT

Copyright 2008 Martin Kutter.

Based on Devel::DProfLB by Jeff Weisberg

This library is free software. You may distribute/modify it under the same terms as perl itself

AUTHOR

Martin Kutter <martin.kutter fen-net.de>

REPOSITORY INFORMATION

 $Rev: 583 $
 $LastChangedBy: kutterma $
 $Id: $
 $HeadURL: $