1NYTPROFHTML(1) User Contributed Perl Documentation NYTPROFHTML(1)
2
3
4
6 nytprofhtml - Generate reports from Devel::NYTProf data
7
9 Typical usage:
10
11 $ perl -d:NYTProf some_perl_app.pl
12 $ nytprofhtml --open
13
14 Options synopsis:
15
16 $ nytprofhtml [-h] [-d] [-o <output directory>] [-f <input file>] [--open]
17
19 Devel::NYTProf is a powerful feature-rich perl source code profiler.
20 See Devel::NYTProf for details.
21
22 "nytprofhtml" generates a set of html reports from the data collected
23 by Devel::NYTProf.
24
25 The reports include dynamic runtime analysis wherein each line and each
26 file is analyzed based on the performance of the other lines and files.
27 As a result, you can quickly find the slowest module and the slowest
28 line in a module. Slowness is measured in three ways: total calls,
29 total time and average time per call.
30
31 Coloring is based on absolute deviations from the median. See
32 <http://en.wikipedia.org/wiki/Median_absolute_deviation> for more
33 details.
34
35 That might sound complicated, but in reality you can just run the
36 command and enjoy your report!
37
39 -f, --file <filename>
40 Specifies the location of the file generated by Devel::NYTProf.
41 Default: ./nytprof.out
42
43 -o, --out <dir>
44 The directory in which to place the generated report files.
45 Default: ./nytprof/
46
47 -d, --delete
48 Purge any existing contents of the report output directory.
49
50 -l, --lib <dir>
51 Add a path to the beginning of @INC to help nytprofhtml find the
52 source files used by the code. Should not be needed in practice.
53
54 --open
55 Make your web browser visit the report after it has been generated.
56
57 -h, --help
58 Print the help message
59
61 You can see a complete report for a large application (over 200 files
62 and 2000 subroutines) at
63 https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-perlcritic-demo/index.html
64 <https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-
65 perlcritic-demo/index.html>
66
67 The report was generated by profiling perlcritic 1.106 checking it's
68 own source code using perl 5.12.1.
69
71 "Unable to open '... (autosplit into ...)'"
72 The profiled application executed code in a module that used AutoLoader
73 to load the code from a separate .al file. NYTProf automatically
74 recognises this situation and tries to determine the 'parent' module
75 file so it can associate the profile data with it. In order to do that
76 the parent module file must already be 'known' to NYTProf, typically by
77 already having some code profiled.
78
79 You're only likely to see this warning if you're using the "start"
80 option to start profiling after compile-time. The effect is that times
81 spent in autoloaded subs won't be associated with the parent module
82 file and you won't get annotated reports for them.
83
84 You can avoid this by using the default "start=begin" option, or by
85 ensuring you execute some non-autoloaded code in the parent module,
86 while the profiler is running, before an autoloaded sub is called.
87
89 A bit of history and a shameless plug...
90
91 NYTProf stands for 'New York Times Profiler'. Indeed, this module was
92 initially developed from Devel::FastProf by The New York Times Co. to
93 help our developers quickly identify bottlenecks in large Perl
94 applications. The NY Times loves Perl and we hope the community will
95 benefit from our work as much as we have from theirs.
96
97 Please visit <http://open.nytimes.com>, our open source blog to see
98 what we are up to, <http://code.nytimes.com> to see some of our open
99 projects and then check out <http://nytimes.com> for the latest news!
100
101 Background
102 Subroutine-level profilers:
103
104 Devel::DProf | 1995-10-31 | ILYAZ
105 Devel::AutoProfiler | 2002-04-07 | GSLONDON
106 Devel::Profiler | 2002-05-20 | SAMTREGAR
107 Devel::Profile | 2003-04-13 | JAW
108 Devel::DProfLB | 2006-05-11 | JAW
109 Devel::WxProf | 2008-04-14 | MKUTTER
110
111 Statement-level profilers:
112
113 Devel::SmallProf | 1997-07-30 | ASHTED
114 Devel::FastProf | 2005-09-20 | SALVA
115 Devel::NYTProf | 2008-03-04 | AKAPLAN
116 Devel::Profit | 2008-05-19 | LBROCARD
117
118 Devel::NYTProf is a (now distant) fork of Devel::FastProf, which was
119 itself an evolution of Devel::SmallProf.
120
121 Adam Kaplan took Devel::FastProf and added html report generation
122 (based on Devel::Cover) and a test suite - a tricky thing to do for a
123 profiler. Meanwhile Tim Bunce had been extending Devel::FastProf to
124 add novel per-sub and per-block timing, plus subroutine caller
125 tracking.
126
127 When Devel::NYTProf was released Tim switched to working on
128 Devel::NYTProf because the html report would be a good way to show the
129 extra profile data, and the test suite made development much easier and
130 safer.
131
132 Then he went a little crazy and added a slew of new features, in
133 addition to per-sub and per-block timing and subroutine caller
134 tracking. These included the 'opcode interception' method of profiling,
135 ultra-fast and robust inclusive subroutine timing, doubling
136 performance, plus major changes to html reporting to display all the
137 extra profile call and timing data in richly annotated and cross-linked
138 reports.
139
140 Steve Peters came on board along the way with patches for portability
141 and to keep NYTProf working with the latest development perl versions.
142
143 Adam's work is sponsored by The New York Times Co.
144 <http://open.nytimes.com>. Tim's work was partly sponsored by
145 Shopzilla. <http://www.shopzilla.com>.
146
148 Mailing list and discussion at
149 http://groups.google.com/group/develnytprof-dev
150 <http://groups.google.com/group/develnytprof-dev>
151
152 Public SVN Repository and hacking instructions at
153 http://code.google.com/p/perl-devel-nytprof/
154 <http://code.google.com/p/perl-devel-nytprof/>
155
156 Devel::NYTProf, Devel::NYTProf::Reader, nytprofcsv
157
159 Adam Kaplan, "<akaplan at nytimes.com>". Tim Bunce,
160 <http://www.tim.bunce.name> and <http://blog.timbunce.org>. Steve
161 Peters, "<steve at fisharerojo.org>".
162
164 This program is free software; you can redistribute it and/or modify it
165 under the same terms as Perl itself, either Perl version 5.8.8 or, at
166 your option, any later version of Perl 5 you may have available.
167
168
169
170perl v5.12.2 2010-11-19 NYTPROFHTML(1)