Stefan Kost wrote: > 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. > Talk is cheap, but here is a patch: https://bugzilla.gnome.org/show_bug.cgi?id=612186
What I don't like so much still: 1) it needs a small hack fro gprof2dot - I am discussing with the author already 2) could someone tell me where to properly free the profile arrays in xsltTemplate? 3) I'd like to print the function index (like in gprof), but for that I would need to know the origin for each template (source:file) probably via templ->style->doc->URL and templ->elem->line Comment welcome Stefan > 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 > _______________________________________________ > xslt mailing list, project page http://xmlsoft.org/XSLT/ > [email protected] > http://mail.gnome.org/mailman/listinfo/xslt > _______________________________________________ xslt mailing list, project page http://xmlsoft.org/XSLT/ [email protected] http://mail.gnome.org/mailman/listinfo/xslt
