Skip to content

perf: cache NamingSystem URLs and send usage stats asynchronously#1254

Closed
jmandel wants to merge 1 commit intoHL7:masterfrom
jmandel:perf/validation-caches
Closed

perf: cache NamingSystem URLs and send usage stats asynchronously#1254
jmandel wants to merge 1 commit intoHL7:masterfrom
jmandel:perf/validation-caches

Conversation

@jmandel
Copy link
Copy Markdown
Contributor

@jmandel jmandel commented Feb 21, 2026

Summary

Two changes:

  1. ValidationServices.resolveURL(): Cache NamingSystem URLs in a HashSet on first use, then do O(1) lookups instead of iterating all NamingSystems on every call. This method is called for every URL resolved during validation. (168 CPU samples in JFR profiling against US Core 9.0.0)

  2. PublisherGenerator: Send usage statistics via a daemon thread instead of blocking the main thread with an HTTP call.

A/B Benchmark

Part of a set of independent changes across Core and Publisher producing 31% overall speedup on US Core 9.0.0. Full details: https://github.com/jmandel/igpublisher-perf

Two changes:

1. ValidationServices.resolveURL(): cache NamingSystem URLs in a HashSet
   on first use, then do O(1) lookups instead of iterating all
   NamingSystems on every call. This method is called for every URL
   resolved during validation. (168 CPU samples in profiling)

2. PublisherGenerator: send usage statistics via a daemon thread instead
   of blocking the main thread with an HTTP call.
@grahamegrieve
Copy link
Copy Markdown
Contributor

The naming system improvements were implemented elsewhere. The usage statistics were already in another thread, so no change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants