Skip to content

Add string-keyed fast path to NS.apply avoiding URI.create per element - #1712

Open
olabusayoT wants to merge 1 commit into
apache:mainfrom
olabusayoT:daf-3092-ns-apply-string-fastpath
Open

Add string-keyed fast path to NS.apply avoiding URI.create per element#1712
olabusayoT wants to merge 1 commit into
apache:mainfrom
olabusayoT:daf-3092-ns-apply-string-fastpath

Conversation

@olabusayoT

@olabusayoT olabusayoT commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

NextElementResolver's OnlyOnePossibilityForNextElement and SeveralPossibilitiesForNextElement both call NS(namespace) on every element resolution when the infoset source has namespaces. NS.apply(String) previously ran URI.create plus a ReentrantReadWriteLock-guarded WeakHashMap lookup on every call, even for a namespace string seen many times before. A ConcurrentHashMap keyed by the raw string now short-circuits repeats before they ever reach URI.create or the lock.

DAFFODIL-3092

NextElementResolver's OnlyOnePossibilityForNextElement and
SeveralPossibilitiesForNextElement both call NS(namespace) on every
element resolution when the infoset source has namespaces. NS.apply(String)
previously ran URI.create plus a ReentrantReadWriteLock-guarded WeakHashMap
lookup on every call, even for a namespace string seen many times before.
A ConcurrentHashMap keyed by the raw string now short-circuits repeats
before they ever reach URI.create or the lock.

DAFFODIL-3092
@olabusayoT
olabusayoT force-pushed the daf-3092-ns-apply-string-fastpath branch from ad5839b to 8070521 Compare July 31, 2026 16:32
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.

1 participant