On Tue, Feb 09, 2010 at 03:33:53PM +0000, Nicholas Clark wrote: > On Tue, Feb 09, 2010 at 03:04:23PM +0000, Tim Bunce wrote: > > > I'd guess you'd see a significant gain in performance by changing > > TIME_BLOCK & TIME_LINE handling along these lines... > > > > - Move the output_tag_int(out, NYTP_TAG_TIME_BLOCK... code > > out of DB_stmt into a new function. > > - Check the return value of the TIME_BLOCK & TIME_LINE handlers. > > - If false then call the new function using the (possibly now modified) > > cb_args[i] values. > > > > That'll save you half a bazillion $out->write & $out->output_int method > > calls. The code would just edit $_[4] and return; > > I had assumed that I was going to implement your earlier plan (first): > > > [...] but I think a better > > approach would be to create a new layer of higher-level functions: > > > > nytp_write_stmt_time(NYTP_file ofile, elapsed, fid, line, block_line, > > sub_line); > > nytp_write_new_fid(NYTP_file ofile, id, eval_fid, eval_line_num, ...) > > > > That would give us encapsulation of the file format. nytprofmerge could > > be significantly faster with an XS interface to those functions.
That would be cool. I was just thinking of the above as a quick hack for a useful gain. > I'm just not yet sure about the C source file names. I assume that the file > handle XS stays in Devel::NYTProf::FileHandle, so it's a name for the low(er) > level IO code, such as output_int() and friends. Seems reasonable. Though perhaps FileHandle should disappear and the guts of it become private to the new higher-level interface. Trying to keep FileHandle around may give more pain for little gain. 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]
