[xslt] xslt callgraph



hi,

xsltproc --profile is quite helpful to find out in which parts of xsl
style sheets most time ist spend. Now if one want to optimize that there
are always two ways:
1.) make the hostspots use less cpu
2.) avoid calling expensive functions

For that a callgraph is useful. WHen using oprofile to profile code I
use this script [1] to render the call graph. The script could easily
adapted to render a xslt callgraph if xsltproc could output the needed data.

Right now output of --profile is like this:
number               match                name      mode  Calls Tot
100us Avg

    0                         gentext.template           120292
1356556     11
    1                                    chunk           118816
457122      3
    2                    *                    recursive-chunk-filename

In oprofile orreport --c (callgraph) output looks like this:

samples  %        image name               app name                
symbol name
-------------------------------------------------------------------------------
  36       100.000  /usr/lib/libgtk-x11-2.0.so.0.1800.3
/usr/lib/libgtk-x11-2.0.so.0.1800.3 gtk_main_do_event
  0              0  /usr/lib/libgtk-x11-2.0.so.0.1800.3
/usr/lib/libgtk-x11-2.0.so.0.1800.3 gtk_propagate_event
  41       97.6190  /usr/lib/libgtk-x11-2.0.so.0.1800.3
/usr/lib/libgtk-x11-2.0.so.0.1800.3 gtk_widget_event_internal
  1         2.3810  /usr/lib/libgdk-x11-2.0.so.0.1800.3
/usr/lib/libgtk-x11-2.0.so.0.1800.3 gdk_window_is_viewable
  0              0  /usr/lib/libgtk-x11-2.0.so.0.1800.3
/usr/lib/libgtk-x11-2.0.so.0.1800.3 gtk_propagate_event [self]
-------------------------------------------------------------------------------

Would it be possible for xsltproc to output something similar? E.g.

%        name
-------------------------------------------------------------------------------
  100       gentext.template
  78         chunk
  ...
-------------------------------------------------------------------------------
<next entry>


Stefan

[1] http://code.google.com/p/jrfonseca/wiki/Gprof2Dot


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