fix(#992): optimize rt-without-atoms XSL with xsl:key - #1090
Conversation
|
@volodya-lombrozo Here is the proof that the optimization works: Local XSLT performance testTest environment:
|
|
/benchmark |
|
|
volodya-lombrozo
left a comment
There was a problem hiding this comment.
@ImilB Could you rebase your changes on master, please? I will be able to run benchmarks on you changes then.
| <xsl:import href="/org/eolang/funcs/lineno.xsl"/> | ||
| <xsl:import href="/org/eolang/funcs/defect-context.xsl"/> | ||
| <xsl:output encoding="UTF-8" method="xml"/> | ||
| <xsl:key name="atoms" match="o" use="exists(o[@name='lambda'])"/> |
There was a problem hiding this comment.
Yes, absolutely. Thanks for pointing that out. I replaced xsl:key with eo:atom(.) here and rebased the branch on master.
Signed-off-by: ImilB <kiwiyt09a@gmail.com>
Signed-off-by: ImilB <kiwiyt09a@gmail.com>
Signed-off-by: ImilB <kiwiyt09a@gmail.com>
Signed-off-by: ImilB <kiwiyt09a@gmail.com>
|
Thanks for the contribution! Unfortunately I can't merge this as-is - none of the 4 commits are signed, and our release tooling (Rultor) rejects unsigned commits regardless of CI status. Could you sign your commits and reopen? Here's GitHub's guide on setting that up: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits |
…bjectionary#1090 Signed-off-by: ImilB <kiwiyt09a@gmail.com>
|
@volodya-lombrozo I added commit signing, recreated the branch with a signed commit, and reopened the PR. GitHub now shows the commit as Verified. |
|
@volodya-lombrozo Thanks for the review! You've earned +4 points for this: +12 as a basis; -5 for very few (1) comments; -4 for too few (6) hits-of-code; +1 to give you at least something. Your running score is +456; don't forget to check your Zerocracy account too). |

Closes #992.
Problem
The rt-without-atoms XSL transformation exceeds 100ms threshold on large XMIR files (~128-129ms).
Root Cause
The check not(//o[eo:atom(.)]) scans the entire document when no atom is found.
eo:atom(.) = exists($o/o[@name=$eo:lambda]) performs a child lookup per element.
When the XMIR file has no atoms, every element is visited, making the cost O(n × degree).
Solution
Added xsl:key for fast lookup of atoms.