On Wed, Jun 10, 2009 at 08:24:06PM -0700, Joshua ben Jore wrote:
> 
> I work in a Perl/Ruby shop. I'd like to use the nytprofhtml report for
> my Ruby code as well. The primitives going into the report appear to
> be source code language agnostic. If I generated a nytprof.out that
> referenced filenames and line ranges in my ruby source, I suspect it
> would produce a similarly nice report.
> 
> Does anyone else have interests along this line of thinking?

It had crossed my mind before (though I was thinking of PHP at the time).

> Some possibilities include generating the binary nytprof.out. This
> tends to require that the format find a way to be more fixed or allow
> evolution but be tolerant of "close enough" input.
> 
> Or allowing the reader to consume something other than just the binary.
> 
> Or a standard converter.
> 
> Or some kind of writer object or function set which could be driven to
> generate the output stream.

I think a converter would be the best way forward at the moment.  It
would let you explore any "impedance mismatch" between the ruby data and
perl data at a high level.

The converter could target the binary nytprof.out format, or the target
the data structure returned by Devel::NYTProf::Data->new. There are pros
and cons to either approach.

I'd recommend targeting the binary nytprof.out format. The current XS
code could add more entry points from perl to call the low-level output
functions. People, like yourself, could then write perl code to generate
nytprof.out files from any data source.

Assuming that's successful the next step could be splitting the
low-level nytprof output code into a separate library that could be
linked in to other languages, like a ruby extension, and so cut out the
conversion step.

Tim.

--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---

Reply via email to