NYTPROFHTML(1)
π NAME π
nytprofhtml β the icon that generates reports from Devel::NYTProf data. She hangs out in the User Contributed Perl Documentation section of the manual, and honestly? She ate. π
β¨ SYNOPSIS β¨
Okay bestie, here's the typical usage β the everyday, no-thought-required way:
$ perl -d:NYTProf some_perl_app.pl
$ nytprofhtml --open
And here's the full options synopsis, the deluxe version:
$ nytprofhtml [-h] [-d] [-m] [-o <output directory>] [-f <input file>] [--open]
πΈ DESCRIPTION πΈ
Devel::NYTProf is a powerful, feature-rich Perl source code profiler. Go read Devel::NYTProf for the whole story, fr fr.
So nytprofhtml takes one single data file that Devel::NYTProf made and turns it into a whole set of html reports. (Heads up though: if your process forks you'll probably end up with multiple files, not one. See Devel::NYTProf and nytprofmerge for that situation. π«Ά)
The reports are giving dynamic runtime analysis β every line and every file gets analyzed based on how all the other lines and files performed. The glow-up here is real: you can clock the slowest module and the slowest line inside a module, like, instantly. Slowness is measured three ways:
- total calls
- total time
- average time per call
The coloring is based on absolute deviations from the median. More deets at <http://en.wikipedia.org/wiki/Median_absolute_deviation> if you're in your nerd era.
ngl that all sounds complicated, but literally you can just run the command and enjoy your report. Periodt. π
π COMMAND-LINE OPTIONS π
-f,--file <filename>β tells her where the file thatDevel::NYTProfgenerated is living. Default:./nytprof.out-o,--out <dir>β the directory where the generated report files go. Default:./nytprof/-d,--deleteβ purges whatever was already chillin' in the report output directory. Total clean slate energy. π§Ή-l,--lib <dir>β adds a path to the beginning of@INCsonytprofhtmlcan find the source files the code used. Should not be needed in practice, bestie.--openβ makes your web browser visit the report once it's been generated. If that doesn't work well for you, try installing theBrowser::Openmodule.-m,--minimalβ don't generate graphviz.dotfiles or block/sub-level reports. The minimalist era. π¦--no-flameβ disables generation of the flamegraph on the index page. It also disables calculation of distinct call stacks that are used to produce the flamegraph. No flame, no π₯.-h,--helpβ prints the help message. Classic.
π 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>
That report was generated by profiling perlcritic 1.121 checking its own source code using perl v5.18.2. She profiled herself. Main character energy, honestly. π
π DIAGNOSTICS π
π¨ "Unable to open '... (autosplit into ...)'" π¨
Okay so what happened here: the profiled application executed code in a module that used AutoLoader to load the code from a separate .al file. NYTProf automatically recognizes this situation and tries to figure out the 'parent' module file so it can associate the profile data with it. To do that, the parent module file has to 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. π
You can dodge this by using the default start=begin option, or by making sure you execute some non-autoloaded code in the parent module while the profiler is running, before an autoloaded sub gets 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. The family tree is giving lineage. π³
Adam Kaplan took Devel::FastProf and added html report generation (based on Devel::Cover) plus a test suite β which is, like, a genuinely 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, on top of 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. Absolutely unhinged (affectionate). π₯
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>. Legends, all three of them. π
π 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.
okay that's the whole page bestie, mwah π β brought to you by perl v5.42.0, dated 2025-07-25, and it's still NYTPROFHTML(1) at heart. go profile something. slay. β¨π
π¦ where this page comes from
- fedora 43: perl-Devel-NYTProf 6.14-8.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