I'm getting performance warnings when running lints against eo-runtime:
[WARNING] XSL transformation 'incorrect-test-object-name' took 119ms, whereas threshold is 100ms
[WARNING] XSL transformation 'incorrect-test-object-name' took 107ms, whereas threshold is 100ms
What happens: For each test object (@name starting with +) the transformation calls eo:escape-plus(@name) (a user-defined function that manipulates the name string) and then matches(..., $regexp) where $regexp is a constant defined inside the for-each. On XMIR files with many test objects the per-element function-call overhead adds up.
What should happen: The transformation completes within the 100ms threshold. Moving $regexp to a top-level variable so Saxon can cache the compiled pattern, and avoiding the user-defined function call where a simple string operation suffices, would help.
I'm getting performance warnings when running lints against
eo-runtime:What happens: For each test object (
@namestarting with+) the transformation callseo:escape-plus(@name)(a user-defined function that manipulates the name string) and thenmatches(..., $regexp)where$regexpis a constant defined inside thefor-each. On XMIR files with many test objects the per-element function-call overhead adds up.What should happen: The transformation completes within the 100ms threshold. Moving
$regexpto a top-level variable so Saxon can cache the compiled pattern, and avoiding the user-defined function call where a simple string operation suffices, would help.