Skip to content

Add serde-saphyr benchmark event path#64

Merged
jskoiz merged 3 commits into
mainfrom
c1/benchmark-serde-saphyr
Jun 7, 2026
Merged

Add serde-saphyr benchmark event path#64
jskoiz merged 3 commits into
mainfrom
c1/benchmark-serde-saphyr

Conversation

@jskoiz

@jskoiz jskoiz commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a private event-backed Serde prototype behind the hidden saneyaml::__unstable_event_serde benchmark surface.
  • Add serde-saphyr benchmark lanes to the real-world, large-input, and dhat harnesses with explicit option normalization and parity preflights.
  • Document the 2026-06-06 results and the current tradeoff: the event-backed path is useful groundwork, but remains private because it is slower than tree-backed saneyaml on the measured corpora and allocation-heavy in dhat.

Verification

Local proof from this checkout:

  • cargo fmt --check
  • git diff --check
  • cargo test --locked
  • cargo clippy --locked --all-targets -- -D warnings
  • scripts/check-feature-clippy.sh
  • cargo test --locked --lib event_de
  • cargo package --locked --allow-dirty

Benchmark captures are recorded in docs/BENCHMARKS.md; the event-backed lane is intentionally documented as benchmark-only, not a public API replacement.

Notes/Risks

  • Hosted PR CI has not completed yet.
  • This keeps serde-saphyr as a dev-only benchmark dependency and does not weaken saneyaml's duplicate-key, merge, tag, YAML 1.2 default, span, lossless, or trust behavior.

jskoiz added 3 commits June 6, 2026 10:16
The event-backed deserializer expands aliases lazily while it walks, so the
parser's literal nesting-depth check did not bound the expanded depth. A
literally shallow document with a long alias chain recursed until the stack
overflowed. Enforce the configured maximum nesting depth during alias
expansion across the value walk, the ignored-node skip, and the key/merge
materialization scan, matching the tree-backed alias handling, which rejects
such documents instead of crashing.

Also deserialize externally-tagged enum variants that carry a payload
(newtype, tuple, and struct variants, plus tag-shorthand variants). The path
previously accepted only bare-scalar unit variants and errored on every
`{Variant: payload}` mapping.
@jskoiz jskoiz marked this pull request as ready for review June 7, 2026 03:42
@jskoiz jskoiz merged commit 1f8ff7f into main Jun 7, 2026
7 checks passed
@jskoiz jskoiz deleted the c1/benchmark-serde-saphyr branch June 7, 2026 03:43
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