DPROFPP(1)
π
DPROFPP(1) β the girlies' guide to dprofpp π
okay so bestie, this is dprofpp β a User Contributed Perl Documentation situation, living in section 1 of your manual. buckle up π
β¨ NAME β¨
dprofpp β display perl profile data πΈ
π¦ SYNOPSIS π¦
dprofpp [-a|-z|-l|-v|-U] [-d] [-s|-r|-u] [-q] [-F] [-I|-E] [-O cnt] [-A]
[-R] [-S] [-g subroutine] [-G <regexp> [-P]] [-f <regexp>] [profile]
dprofpp -T [-F] [-g subroutine] [profile]
dprofpp -t [-F] [-g subroutine] [profile]
dprofpp -G <regexp> [-P] [profile]
dprofpp -p script [-Q] [other opts]
dprofpp -V [profile]
π DESCRIPTION π
so the dprofpp command is literally the translator for profile data that some profiler made β think Devel::DProf and friends. it reads the file tmon.out and shows you the 15 subroutines that are eating up the most time. by default, the times for each subroutine are exclusive of the times of their child subroutines β so it's like, your own time only, no nepo babies π«Ά
wanna profile a Perl script? run the perl interpreter with the -d switch. so to profile the script test.pl with Devel::DProf, you do:
$ perl5 -d:DProf test.pl
then you run dprofpp to analyze the profile. the output of dprofpp depends on the flags you pass the program and the version of Perl you're on, so don't come for me if it looks different β¨
$ dprofpp -u
Total Elapsed Time = 1.67 Seconds
User Time = 0.61 Seconds
Exclusive Times
%Time Seconds #Calls sec/call Name
52.4 0.320 2 0.1600 main::foo
45.9 0.280 200 0.0014 main::bar
0.00 0.000 1 0.0000 DynaLoader::import
0.00 0.000 1 0.0000 main::baz
and get this β the dprofpp tool can also run the profiler before it analyzes the profile data. those two commands above? one single dprofpp command. slay.
$ dprofpp -u -p test.pl
if you want the tea on what the raw profile actually looks like, consult "PROFILE FORMAT" in Devel::DProf π
π OUTPUT π
here's what each column is giving:
%Time
percentage of time spent in this routine. lowkey the main character stat π
#Calls
number of calls to this routine.
sec/call
average number of seconds per call to this routine.
Name
name of routine. iconic, no notes.
CumulS
time (in seconds) spent in this routine and routines called from it.
ExclSec
time (in seconds) spent in this routine (not including those called from it).
Csec/c
average time (in seconds) spent in each call of this routine (including those called from it).
π OPTIONS π
-aβ sort alphabetically by subroutine names.-dβ reverse whatever sort is used. flip the script fr fr.-Aβ count timing for autoloaded subroutine as timing for*::AUTOLOAD. otherwise the time to autoload it is counted as time of the subroutine itself (there is no way to separate autoload time from run time).
heads up bestie: this is going to be irrelevant with newer Perls. they will inform"Devel::DProf"when the"AUTOLOAD"switches to actual subroutine, so a separate statistics for"AUTOLOAD"will be collected no matter whether this option is set. so like, chill π
-Rβ count anonymous subroutines defined in the same package separately. give the mystery subs their own identity β¨-Eβ (default) display all subroutine times exclusive of child subroutine times.-Fβ force the generation of fake exit timestamps ifdprofppreports that the profile is garbled. this is only useful ifdprofppdetermines that the profile is garbled due to missing exit timestamps.
β οΈ you're on your own if you do this. consult the BUGS section. not me warning you and then you doing it anyway π
-Iβ display all subroutine times inclusive of child subroutine times. bring the whole family π«Ά-lβ sort by number of calls to the subroutines. this may help identify candidates for inlining.-O cntβ show only cnt subroutines. the default is15.-p scriptβ tellsdprofppthat it should profile the given script and then interpret its profile data. see-Q.-Qβ used with-pto telldprofppto quit after profiling the script, without interpreting the data. just profile and dip π¨-qβ do not display column headers.-rβ display elapsed real times rather than user+system times.-sβ display system times rather than user+system times.-Tβ display subroutine call tree to stdout. subroutine statistics are not displayed.-tβ display subroutine call tree to stdout. subroutine statistics are not displayed. when a function is called multiple consecutive times at the same calling level then it is displayed once with a repeat count.-Sβ display merged subroutine call tree to stdout. statistics are displayed for each branch of the tree.- when a function is called multiple (not necessarily consecutive) times in the same branch then all these calls go into one branch of the next level. a repeat count is output together with combined inclusive, exclusive and kids time.
- branches are sorted with regard to inclusive time.
-Uβ do not sort. display in the order found in the raw profile. chaos mode, respect it π-uβ display user times rather than user+system times.-Vβ printdprofpp's version number and exit. if a raw profile is found then itsXS_VERSIONvariable will be displayed, too.-vβ sort by average time spent in subroutines during each call. this may help identify candidates for inlining.-zβ (default) sort by amount of user+system time used. the first few lines should show you which subroutines are using the most time.-g "subroutine"β ignore subroutines except"subroutine"and whatever is called from it. tunnel vision, but make it intentional π¦-G <regexp>β aggregate"Group"all calls matching the pattern together. for example this can be used to group all calls of a set of packages
-G "(package1::)|(package2::)|(package3::)"
or to group subroutines by name:
-G "getNum"
-Pβ used with-Gto aggregate"Pull"together all calls that did not match-G.-f <regexp>β filter all calls matching the pattern.-hβ display brief help and exit.-Hβ display long help and exit.
πΈ ENVIRONMENT πΈ
the environment variable DPROFPP_OPTS can be set to a string containing options for dprofpp. you might use this if you prefer -I over -E or if you want -F on all the time. set it and forget it bestie β¨
ngl, this was added fairly lazily, so there are some undesirable side effects. options on the commandline should override options in DPROFPP_OPTS β but don't count on that in this version. π«
π BUGS π
- applications which call
_exit()orexec()from within a subroutine will leave an incomplete profile. see the-Foption. - any bugs in
Devel::DProf, or any profiler generating the profile data, could be visible here. see "BUGS" in Devel::DProf. - mail bug reports and feature requests to the perl5-porters mailing list at
<perl5-porters@perl.org>. bug reports should include the output of the-Voption. (yes, the-Voutput is mandatory, they said what they said π§)
π FILES π
dprofpp - profile processor
tmon.out - raw profile
β SEE ALSO β
perl, Devel::DProf, times(2)
and that's the whole page, bestie!! this one's from perl v5.42.0, dated 2025-07-25 β go forth and profile, you absolute icon ππβ¨
π¦ where this page comes from
- fedora 43: perl-Devel-DProf 20110802.00-45.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms