1Devel::FastProf(3) User Contributed Perl Documentation Devel::FastProf(3)
2
3
4
6 Devel::FastProf - "fast" perl per-line profiler
7
9 $ perl -d:FastProf my_script.pl
10 $ fprofpp -t 10
11
13 Devel::FastProf tells you how much time has been spent on every line of
14 your program.
15
17 "Devel::FastProf" is a perl per-line profiler. What that means is that
18 it can tell you how much time is spent on every line of a perl script
19 (the standard Devel::DProf is a per-subroutine profiler).
20
21 I have been the maintainer of Devel::SmallProf for some time and
22 although I found it much more useful that Devel::DProf, it had an
23 important limitation: it was terribly slow, around 50 times slower than
24 the profiled script being run out of the profiler.
25
26 So, I rewrote it from scratch in C, and the result is
27 "Devel::FastProf", that runs only between 3 and 5 times slower than
28 under normal execution... well, maybe I should have called it
29 "Devel::NotSoSlowProf" ;-)
30
31 To use "Devel::FastProf" with your programs, you have to call perl with
32 the "-d" switch (see perlrun) as follows:
33
34 $ perl -d:FastProf my_script.pl
35
36 "Devel::FastProf" will write the profiling information to a file named
37 "fastprof.out" under the current directory.
38
39 To analyse the information on this file use the post processor script
40 fprofpp included with this package.
41
42 Some options can be passed to "Devel::FastProf" via the environment
43 variable "FASTPROF_CONFIG":
44
45 filename=otherfn.out
46 allows to change the name of the output file.
47
48 usecputime
49 by default, "Devel::FastProf" meassures the wall clock time spent
50 on every line, but if this entry is included it will use the cpu
51 time (user+system) instead.
52
53 canfork
54 this option has to be used if the profiled script forks new
55 processes, if you forget to do so, a corrupted "fastprof.out" file
56 could be generated.
57
58 Activating this mode causes a big performance penalty because write
59 operations from all the processes have to be serialized using
60 locks. That is why it is not active by default.
61
62 This is an example of how to set those options:
63
64 $ FASTPROF_CONFIG="usecputime,filename=/tmp/fp.out" \
65 perl -d:FastProf myscript.pl
66
68 No Windows! No threads!
69
70 Only tested on Linux. It is know not to work under Solaris.
71
72 The code of subroutines defined inside "eval "..."" constructions that
73 do not include any other code will not be available on the reports.
74 This is caused by a limitation on the perl interpreter.
75
76 Option -g is buggy, it only works when all the modules are loaded in
77 the original process.
78
79 Perl 5.8.8 or later is recomended. Older versions have a bug that cause
80 this profiler to be slower.
81
82 If you find any bug, please, send me an e-mail to sfandino@yahoo.com or
83 report it via the CPAN RT system.
84
86 fprofpp, perlrun, Devel::SmallProf, Devel::Dprof, perldebug and
87 perldebguts.
88
90 Copyright (C) 2005-2007 by Salvador FandiƱo <sfandino@yahoo.com>.
91
92 This library is free software; you can redistribute it and/or modify it
93 under the same terms as Perl itself, either Perl version 5.8.7 or, at
94 your option, any later version of Perl 5 you may have available.
95
96
97
98perl v5.30.0 2019-07-26 Devel::FastProf(3)