Repository navigation
Experiment: avoid locks for empty xsi:type registries - #139
Draft
nth-bailey wants to merge 7 commits into
Draft
nth-bailey wants to merge 7 commits into
nth-bailey wants to merge 7 commits into
Conversation
nth-bailey
changed the base branch from
perf/xml-runtime-investigation
to
main
October 4, 2026 04:15
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Avoid registry read locks when a shared schema has no xsi:type variants. Keep the populated flag and registry update synchronized in the setter; cloned schemas share both. Add set/clear and concurrent-reader tests plus a matched empty/populated dispatch benchmark.
The experiment has a measured tradeoff. Three process pairs show empty-registry writes about 6.8% faster and tiny ordinary writes about 11 ns faster, while registered-variant reads are about 1.6% slower. Ordinary catalog reads are flat. Do not merge this on a broad parsing-speedup claim.
Retained evidence includes every Criterion sample, confidence interval, exact source patch, allocation diagnostics, Callgrind profiles, and unsuccessful borrowing/frame-size/fixed-guard experiments. See the experiment report.
Validation: 323 Rust tests, strict workspace formatting and Clippy, Ruff, and 112 Python tests with 100% statement/branch coverage.
Stacked on #137. Keep this draft for review of the workload tradeoff and synchronization cost.
Additional retained prototypes cover attribute guards and their combination with the registry flag: combined reads improve 3.5–4.1%, with mixed write tradeoffs. These prototypes are archived for review and are not part of this PR’s implementation.