Re: simplelist speed - profiling




On Jan 9, 2005, at 2:38 PM, Dan Espen wrote:

Does anyone know the trick to profiling perl code?

what you describe is two different things.

perl -dDProf profiles the subroutine calls of your script.

compiling perl with -pg will profile the actual binary and C-level calls.


Then I recompiled Gtk2-1.061 with CCFLAGS=-pg and produced a Gtk2.so.
Then I compiled perl with Configure -Doptimize=-pg and ran my perlscript
with perl.gprof.  That produced a gmon.out, but gtk never appears
in the output, only the perl module itself, like this:

if glib/gtk+/gdk/Xlib have not been compiled with profiling options, they won't appear in the profiler output.


  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 10.29      0.14     0.14    83933     1.67     1.93  S_hv_fetch_common
  5.15      0.21     0.07    24160     2.90     2.93  Perl_gv_fetchpv
  5.15      0.28     0.07      166   421.69   480.69  Perl_yyparse

Is there some way to profile the lower layers of this stuff?

those are the lower layers --- you're seeing the actual interpreter calls that implement parsing a perl script (yyparse) and manipulating hashes (hv_fetch_common) and global variables (gv_fetch_pv).


--
Examples really shouldn't include unexploded ordnance.
  -- Joe Smith, referring to an example program i wrote.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]