Bug #6451
openThe profiler feature does not work (i.e. -TP)
0%
Description
User reported that the TimingTraceListener
does not work via the API. See: https://saxonica.plan.io/boards/3/topics/9668
Example code from user:
SaxonProcessor* processor = new SaxonProcessor(false);
processor->setConfigurationProperty("http://saxon.sf.net/feature/traceListenerClass", "net.sf.saxon.trace.TimingTraceListener");
processor->setConfigurationProperty("http://saxon.sf.net/feature/traceListenerOutputFile", "c:\\temp\\profile.html");
processor->setConfigurationProperty("http://saxon.sf.net/feature/timing", "1");
However I found that the -TP
option works via the command-line tool in SaxonC.
The following worked for me:
./transform -xsl:../samples/data/test.xsl -s:../samples/data/cat.xml -TP:profile.html
Updated by Michael Kay 5 months ago
There isn't an API as such for doing this, there are several steps needed split across compile time and runtime, and the logic is mainly in the net.sf.saxon.Transform
class which only supports the command line. I guess we could add a method to the XsltCompiler to do the same thing, the logic would have to carry through into the XsltTransformer behind the scenes.
Note also, the code in net.sf.saxon.Transform
is excluded from SaxonCS, I'm not sure why.
There are also requests for instrumentation more focused on coverage data than profiling. If we do design an API, it should probably be something along the lines
XsltCompiler.setInstrumentation(Instrumentation ii)
where Instrumentation is an interface that can have multiple implementations, one of which is the Profiler.
Please register to edit this issue