Reads a profile data file written by Devel::NYTProf, aggregates the contents, and returns the results as a blessed data structure.

Access to the data should be via methods in this class to avoid breaking encapsulation (and thus breaking your code when the data structures change in future versions).

NOTE the documentation is out of date and may not be updated soon. It's also likely that the API will change drastically in future. It's possible, for example, that the data model will switch to use SQLite and the http://metacpan.org/pod/ORLite ORM.

Let me know if you come to depend on a particular API and I'll try to preserve it if practical.

Writes the profile data in a reasonably human friendly format to the specified filehandle (default STDOUT).

For non-trivial profiles the output can be very large. As a guide, there'll be at least one line of output for each line of code executed, plus one for each place a subroutine was called from, plus one per subroutine.

The default format is a Data::Dumper style whitespace-indented tree. The types of data present can depend on the options used when profiling.

If separator is true then instead of whitespace, each item of data is indented with the path through the structure with separator used to separate the elements of the path. This format is especially useful for grep'ing and diff'ing.

Returns a reference to a hash containing information about subroutines defined in a source file. The $file argument can be an integer file id (fid) or a file path.

Returns undef if the profile contains no sub_subinfo data for the $file.

The keys of the returned hash are fully qualified subroutine names and the corresponding value is a hash reference containing Devel::NYTProf::SubInfo objects.

If $include_lines is true then the hash also contains integer keys corresponding to the first line of the subroutine. The corresponding value is a reference to an array. The array contains a hash ref for each of the subroutines defined on that line, typically just one.

Copyright (C) 2008 by Adam Kaplan and The New York Times Company.
Copyright (C) 2008,2009 by Tim Bunce, Ireland.

This library 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.