Skip to content

fix(#991): optimize atom-in-atom XSL with xsl:key - #1166

Open
ImilB wants to merge 2 commits into
objectionary:masterfrom
ImilB:fix-991
Open

fix(#991): optimize atom-in-atom XSL with xsl:key#1166
ImilB wants to merge 2 commits into
objectionary:masterfrom
ImilB:fix-991

Conversation

@ImilB

@ImilB ImilB commented Jul 30, 2026

Copy link
Copy Markdown

Closes #991.

Problem

The atom-in-atom XSL transformation exceeds 100ms threshold on large XMIR files (~120ms).

Root Cause

The selector //o[eo:atom(.) and o[eo:atom(.)]] calls eo:atom(.) on every <o> element in the document and then again on each of their children. eo:atom(.) = exists($o/o[@name=$eo:lambda]) performs a child element lookup each time. The effective cost is O(n × degree), which on large XMIR files with many objects and children exceeds the threshold.

Solution

Added xsl:key for fast lookup of atoms and replaced the expensive function calls.

ImilB added 2 commits July 30, 2026 15:15
Closes objectionary#991.

## Problem
The `atom-in-atom` XSL transformation exceeds 100ms threshold on large XMIR files (~120ms).

## Root Cause
The selector `//o[eo:atom(.) and o[eo:atom(.)]]` calls `eo:atom(.)` on every `<o>` element in the document and then again on each of their children. `eo:atom(.) = exists($o/o[@name=$eo:lambda])` performs a child element lookup each time. The effective cost is O(n × degree), which on large XMIR files with many objects and children exceeds the threshold.

## Solution
Added `xsl:key` for fast lookup of atoms and replaced the expensive function calls.

Signed-off-by: ImilB <kiwiyt09a@gmail.com>
Signed-off-by: ImilB <kiwiyt09a@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

atom-in-atom XSL transformation exceeds 100ms threshold on large XMIR files

1 participant