Devel::NYTProf
The Devel::NYTProf module started at the New York Times
by Adam Kaplan, although it’s currently maintained outside the
Times now. It’s fast (written in C), it’s powerful,
and it makes nice reports. It’s the fastest statement and subroutine
profiler available, and we don’t have enough room to tell you all of the
wonderful things about it. Download it from CPAN, and then use it just
like the other debuggers:
% perl –d:NYTProf your_programOnce finished, you can inspect the results as HTML files. The first HTML file (Figure 18-1) is the summary:
% nytprofhtml ––open
Figure 18-1. The starting page for the HTML view of NYTProf
You can set various options in the NYTPROF environment variable. For instance, you can tell the
profiler when to start: right away, at the INIT phase, or at the beginning of the
END:
% env NYTPROF=start=init perl –d:NYTProf your_programSee the module documentation for more details. Now go take that coffee break. You’ll need it for the next chapter.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access