Project

Profile

Help

Bug #6451

open

The profiler feature does not work (i.e. -TP)

Added by O'Neil Delpratt 5 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Category:
Saxon-C Internals
Start date:
2024-06-12
Due date:
% Done:

0%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
12.4.2
Fixed in version:
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

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
Actions #1

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

Also available in: Atom PDF