From 0fbd32e7c3811e3a1c2bd16130cbe5358c4d3d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Mon, 13 Jul 2026 22:54:02 +0300 Subject: [PATCH] Hoist the loop-invariant ontology-URI lookup out of the label predicate SaxonJS does not hoist local:ontology-uri($vocab) out of the predicate in local:ontology-label, so the whole vocabulary document was rescanned once per description element - quadratic on the striped, 1400-description dcterms.rdf and ~1.4s of every editor boot spent in init-overlay. Binding the URI to a variable first makes the scan linear: init-overlay drops from ~1430ms to ~20ms, and the toolbar appears at ~0.7s instead of ~2.1s after navigation (measured headless on localhost). Co-Authored-By: Claude Fable 5 --- src/vocab.xsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vocab.xsl b/src/vocab.xsl index 93e724f..a9d1d1b 100644 --- a/src/vocab.xsl +++ b/src/vocab.xsl @@ -53,8 +53,11 @@ version="3.0"> + + + select="$vocab/rdf:RDF/*[@rdf:about = $ontology-uri]"/>