Bug #6451
closedThe 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 7 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.
Updated by O'Neil Delpratt 29 days ago
- Status changed from New to Rejected
I am marking this bug issue as rejected
for now because the profiler option is not currently supported in the API. If we choose to add this feature in the future then we can reopen this bug issue.
Please register to edit this issue