A very brief post, capturing a crib-sheet of sorts on profiling with Perl for when I need it next. First, I’m using NYTProf, and huge props to the developers! Free Perl profiling is an absolute delight.
Second, all the info below can be drawn from that NYTProf link, but there’s a lot of verbage. So, here’s the absolute bare-bones essence of getting Perl profiling going with the module:
- Have NYTProf installed so Perl’s @INC array finds it (ActiveState Perl makes it dead easy with their package manager).
- Add a line to the opening preamble of the bootstrap perl file
- Run the perl file from the command-line thusly:
# perl -d:NYTProf bootstrap.pl
- Once finished, there will be a file called ‘nytprof.out’ in the same directory, which builds as the script runs. Use the following executable supplied with the module, to convert the raw output file to a richly-endowed set of web pages containing human-grokable profiler gold:
- This creates a directory ‘/nytprof’ in the same directory. Find the ‘index.html’ file inside it, and open it with your favourite web browser.
And here are some froody ideas around Perl efficiency once a bottleneck has been isolated.
On a side note, IDE support including breakpoint debugging, and now profiling. Punching Perl through the “just for glue” ceiling into “TISM” territory.
Think I’ll rename myself Greg and go hooning: