FontoXPath can output a basic trace for an error if the debug option is set to true. This is disabled by default because of performance reasons.
FontoXPath can use the Performance API to provide some insight in the speed of XPaths. To use it, first give FontoXPath an implementation of the Performance interface:
This summary contains an array of XPaths, their execution times, their total runtime and their average runtime. Starting a performance profile will also output measurements on the timeline of the performance profiler of the browser.
The arguments are the same as evaluateXPath. This returns a Promise<Object>, the object has a xdmValue and pendingUpdateList. The xdmValue is the result of query as if it was run using evaluateXPath with evaluateXPath.ANY_TYPE as returnType. The pendingUpdateList is an <Object> in which each entry represents an update primitive where the type identifies the update primitive.