[6.x.x] New exist:time XQuery Pragma #5077
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backported from FusionDB - A new XQuery Pragma called
exist:time
that is backwards compatible with the previous limitedexist:timer
pragma.Like its predecessor
exist:timer
it can be used for timing an XQuery expression. However, its main advantage is that it can also be used to log multiple iterations of the same expression using the parametermeasurement-mode=multiple
. In addition to that the newexist:time
pragma also adds:ns
andms
units depending on the magnitude of the measurementlogging-level
parameter so that you may set the log-level dynamically on invocation.log-message-prefix
so that you may specify a prefix to be appended to the log message; this can make it much easier for you when trying to locate specific log messages.Example 1 - Single measurement
produces log output like:
Example 2 - Single iteration measurements inside FLWOR
produces log output like:
Example 3 - Multiple iteration measurement inside FLWOR
This new facility is extremely useful for helping diagnose performance issues when you have a loop that is slow, but the expressions inside the loop itself appear fast. In such a scenario you can use
exist:time
to measure the performance of one or more expressions within the loop.produces log output like: