On Thu, Jan 08, 2009 at 10:35:03PM -0500, David Steinbrunner wrote:
>
> Hello all,
>
> I have seen the past thread with the same subject and hence know that this
> on the TODO list. I'm interested in seeing it moved from the TODO list to
> feature list. Rather than ask that someone else do it I would like to ask
> how I could do it.
Great!
> Currently I have no idea what is going on under the covers of NYTProf so at
> this point I feel like I would need some hand holding to get me started. Is
> it worth the time it would take to discuss what should be done or would it
> be best to leave it to the current maintainers that understand what is going
> on.
>
> Maybe regardless of if I could handle the implementation it might be a good
> idea just discuss how it should be implemented. My first question would be
> where the merge point should be, during the profiling or via the reporting
> tools?
Via the reporting tools.
load_profile_data_from_file() in NYTProf.xs reads a profile data file
and returns a (large) data structure. I recommend you implement a
$profile->merge_profile_data_from_file($file) method in
Devel::NYTProf::Data that would call
my $new = load_profile_data_from_file($file);
and then "merge" the data from $new data into the existing $profile.
We can talk about how to merge each kind of data within $new (attribute,
fid_block_time, sub_subinto etc) once you've explored it a little.
A good way to do that is to profile the t/*.p scripts and look at the
corresponding profile data. You can use the NYTPROF_ONLOAD env var hack
to make that easier. Set it to "dump=1:exit=0" to make NYTProf dump the
data (using Data::Dumper) and then exit(0) instead of returning from
Devel::NYTProf::Data->new. (Update to trunk r668 first to get that.)
I'm honestly not sure how much work is involved here, I'll happily help
you along the way (and hack around what you're doing to smooth the path).
I'm pretty sure it can be useful long before it's perfect, and that lots
of people will be very grateful!
Tim.
p.s. Send me an email address associated with a google account and I'll
give you commit access.
p.p.s A good first step would be to add a stub merge_profile_data_from_file()
method and update nytprofhtml to use it. Perhaps via a
Devel::NYTProf::Data->new_merged({ files => \...@files }) method that
calls load_profile_data_from_file() for the first and
merge_profile_data_from_file() for the rest.
--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]
-~----------~----~----~----~------~----~------~--~---