NYTPROFHTML(1p)
π NAME π
nytprofhtml β Generate reports from Devel::NYTProf data π
yep, this is a perl man page (section 1p, "User Contributed Perl Documentation", the good stuff) for the lil script that turns your profiler data into html glow-ups β¨
β¨ SYNOPSIS β¨
Typical usage, i.e. the way you'll fr fr be doing it:
$ perl -d:NYTProf some_perl_app.pl
$ nytprofhtml --open
And the options synopsis, for when you wanna see the whole fit:
$ nytprofhtml [-h] [-d] [-m] [-o <output directory>] [-f <input file>] [--open]
π DESCRIPTION π
okay so first thing: Devel::NYTProf is a powerful feature-rich Perl source code profiler. If you want the lore, go read Devel::NYTProf. π
nytprofhtml takes a single data file generated by Devel::NYTProf and turns it into a whole set of html reports. Heads up bestie: if your process forks you'll probably end up with multiple files, and that's a whole different era β see Devel::NYTProf and nytprofmerge.
The reports include dynamic runtime analysis, wherein each line and each file is analyzed based on the performance of the other lines and files. The way that works out for you? You can quickly find the slowest module and the slowest line in a module. π₯
Slowness gets measured three ways:
- total calls
- total time
- average time per call
Coloring is based on absolute deviations from the median. If you want more on that, it's at http://en.wikipedia.org/wiki/Median_absolute_deviation.
ngl that might sound complicated, but in reality you can just run the command and enjoy your report! π
π COMMAND-LINE OPTIONS π
-f,--file <filename>β Specifies the location of the file generated byDevel::NYTProf. Default:./nytprof.out-o,--out <dir>β The directory in which to place the generated report files. Default:./nytprof/-d,--deleteβ Purge any existing contents of the report output directory. (Purge. Existing. Contents. π it is not playing.)-l,--lib <dir>β Add a path to the beginning of@INCto helpnytprofhtmlfind the source files used by the code. Should not be needed in practice.--openβ Make your web browser visit the report after it has been generated. If this doesn't work well for you, try installing theBrowser::Openmodule. π¦-m,--minimalβ Don't generate graphviz.dotfiles or block/sub-level reports.--no-flameβ Disable generation of the flamegraph on the index page. Also disables calculation of distinct call stacks that are used to produce the flamegraph. π₯π«-h,--helpβ Print the help message.
π¦ SAMPLE OUTPUT π¦
You can see a complete report for a large application at http://timbunce.github.io/devel-nytprof/sample-report/nytprof-20160319/index.html π
The report was generated by profiling perlcritic 1.121 checking its own source code using perl v5.18.2. (yes it profiled itself checking itself, main character energy fr)
π DIAGNOSTICS π
πΈ "Unable to open '... (autosplit into ...)'"
The profiled application executed code in a module that used AutoLoader to load the code from a separate .al file. NYTProf automatically recognises this situation and tries to determine the 'parent' module file so it can associate the profile data with it. In order to do that the parent module file must already be 'known' to NYTProf, typically by already having some code profiled.
You're only likely to see this warning if you're using the start option to start profiling after compile-time. The effect is that times spent in autoloaded subs won't be associated with the parent module file and you won't get annotated reports for them. π (not the missing annotations)
You can avoid this by using the default start=begin option, or by ensuring you execute some non-autoloaded code in the parent module, while the profiler is running, before an autoloaded sub is called. π«Ά
π Background
Subroutine-level profilers:
Devel::DProf | 1995-10-31 | ILYAZ
Devel::AutoProfiler | 2002-04-07 | GSLONDON
Devel::Profiler | 2002-05-20 | SAMTREGAR
Devel::Profile | 2003-04-13 | JAW
Devel::DProfLB | 2006-05-11 | JAW
Devel::WxProf | 2008-04-14 | MKUTTER
Statement-level profilers:
Devel::SmallProf | 1997-07-30 | ASHTED
Devel::FastProf | 2005-09-20 | SALVA
Devel::NYTProf | 2008-03-04 | AKAPLAN
Devel::Profit | 2008-05-19 | LBROCARD
Devel::NYTProf is a (now distant) fork of Devel::FastProf, which was itself an evolution of Devel::SmallProf.
Adam Kaplan took Devel::FastProf and added html report generation (based on Devel::Cover) and a test suite β a tricky thing to do for a profiler. Meanwhile Tim Bunce had been extending Devel::FastProf to add novel per-sub and per-block timing, plus subroutine caller tracking. π
When Devel::NYTProf was released Tim switched to working on Devel::NYTProf because the html report would be a good way to show the extra profile data, and the test suite made development much easier and safer.
Then he went a little crazy and added a slew of new features, in addition to per-sub and per-block timing and subroutine caller tracking. These included the 'opcode interception' method of profiling, ultra-fast and robust inclusive subroutine timing, doubling performance, plus major changes to html reporting to display all the extra profile call and timing data in richly annotated and cross-linked reports. π₯π₯
Steve Peters came on board along the way with patches for portability and to keep NYTProf working with the latest development Perl versions. π«Ά
Adam's work is sponsored by The New York Times Co. http://open.nytimes.com. Tim's work was partly sponsored by Shopzilla. http://www.shopzilla.com.
π«Ά SEE ALSO π«Ά
Mailing list and discussion at http://groups.google.com/group/develnytprof-dev
Public Github Repository and hacking instructions at https://github.com/timbunce/devel-nytprof/
Devel::NYTProf, Devel::NYTProf::Reader, nytprofcsv
π AUTHOR π
Adam Kaplan, "<akaplan at nytimes.com>". Tim Bunce, http://blog.timbunce.org. Steve Peters, "<steve at fisharerojo.org>".
π COPYRIGHT AND LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
π and that's the whole page bestie β go profile something and enjoy your report π
bye babes!! this was perl v5.42.3, dated 2026-08-20, page NYTPROFHTML(1p) β periodt π
β¨
π¦ where this page comes from
- ubuntu stonking: libdevel-nytprof-perl 6.15+dfsg-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms