Skip to content

Experiment: avoid locks for empty xsi:type registries - #139

Merged
nth-bailey merged 7 commits into
mainfrom
perf/xml-variant-registry
Oct 11, 2026
Merged

nth-bailey merged 7 commits into
mainfrom
perf/xml-variant-registry

Conversation

@nth-bailey

@nth-bailey nth-bailey commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@nth-bailey
nth-bailey deleted the branch main October 4, 2026 04:14
@nth-bailey nth-bailey closed this Oct 4, 2026
@nth-bailey nth-bailey reopened this Oct 4, 2026
@nth-bailey
nth-bailey changed the base branch from perf/xml-runtime-investigation to main October 4, 2026 04:15
@nth-bailey
nth-bailey force-pushed the perf/xml-variant-registry branch from 3d93d84 to b9a307e Compare October 11, 2026 13:50
@nth-bailey
nth-bailey marked this pull request as ready for review October 11, 2026 13:51
@nth-bailey
nth-bailey merged commit dd0a64f into main Oct 11, 2026
30 checks passed
@nth-bailey
nth-bailey deleted the perf/xml-variant-registry branch October 11, 2026 13:58
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