Skip to content

Cache Woodstox XMLInputFactory#33

Merged
vpaturet merged 1 commit into
masterfrom
cache_woodstox_input_factory
Feb 27, 2026
Merged

Cache Woodstox XMLInputFactory#33
vpaturet merged 1 commit into
masterfrom
cache_woodstox_input_factory

Conversation

@vpaturet

@vpaturet vpaturet commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Profiling in OpenTripPlanner shows excess CPU usage/ memory allocation due to the repeated construction of XMLInputFactory objects.

The contract of XMLInputFactory does not guarantee that concrete implementations are thread-safe.
However some libraries like Woodstox provide thread-safe XMLInputFactory implementations and encourage users to reuse instances across threads (see https://github.com/FasterXML/Woodstox4/blob/master/release-notes/USAGE).

This PR updates the SIRI parser so that it detects the use of Woodstox XMLInputFactory and caches it.
For all other implementations, the XMLInputFactory is re-created at every call, as before.

@vpaturet vpaturet requested a review from lassetyr February 27, 2026 11:01
@vpaturet vpaturet merged commit dc4573e into master Feb 27, 2026
10 of 11 checks passed
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.

2 participants