No description
  • Rust 64.1%
  • C 11.9%
  • C++ 10.6%
  • Python 10.5%
  • Shell 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-02 23:58:16 -05:00
benches Add astral-yaml 0.0.8 and astral-yaml-serde 0.0.8 to comparative harness 2026-12-01 14:47:08 -05:00
crates/yaml-c-ffi harness(AY-184): emit schema-v2 self-describing bundles, expand 11-peer emitters, and add tape typed Serde 2026-11-29 14:34:01 -05:00
scripts Update repository references from asamarts to zeropier 2026-12-02 23:58:16 -05:00
src Add astral-yaml 0.0.8 and astral-yaml-serde 0.0.8 to comparative harness 2026-12-01 14:47:08 -05:00
.gitignore Initial standalone comparative YAML benchmark harness for ayaml 2026-11-27 23:04:52 -05:00
Cargo.lock Update repository references from asamarts to zeropier 2026-12-02 23:58:16 -05:00
Cargo.toml Update repository references from asamarts to zeropier 2026-12-02 23:58:16 -05:00
LICENSE-APACHE Initial standalone comparative YAML benchmark harness for ayaml 2026-11-27 23:04:52 -05:00
LICENSE-MIT Initial standalone comparative YAML benchmark harness for ayaml 2026-11-27 23:04:52 -05:00
NOTICE Initial standalone comparative YAML benchmark harness for ayaml 2026-11-27 23:04:52 -05:00
README.md Update repository references from asamarts to zeropier 2026-12-02 23:58:16 -05:00

ayaml-benchmarks

Standalone, reproducible comparative YAML benchmark and allocation harness for ayaml.

This repository lives outside zeropier/ayaml so the main ayaml workspace remains 100% pure Rust (#![forbid(unsafe_code)]) with zero C/C++ build dependencies, while allowing any engineer to inspect, verify, and re-run every Rust, C, and C++ peer comparison end-to-end.

What is measured

All benchmarks consume the deterministic, SHA-256-verified fixture catalog from ayaml-fixtures (26 curated scenarios spanning realistic domain workloads, the 4 KiB boundary fixtures, 10 KiB / 100 KiB / 1 MiB scaling ladders, and structural stress shapes):

  • Tier 1 (Zero-copy & structural):
    • ayaml: scan (tokenizer via bench-internals), events (public pull-based ayaml::parse_events iterator), tape (cold flat-array parse_tape / parse_tape_documents), tape-reuse (warm ParserBuf + recycle_into), spanned (SpannedTree)
    • astral-yaml (0.0.8): spanned (astral_yaml::parse, spanned + commented arena Stream)
    • rapidyaml (v0.16.0): parse-arena, parse-in-place, parse-reuse
    • libyaml (0.2.6): events, load (all documents in multi-doc streams)
    • libfyaml (v1.0.0-rc2): events, doc
  • Tier 2 (Full semantic / typed DOM & Serde):
    • ayaml: value (parse_value / parse_documents), serde-value, compat-serde, typed, borrowed, tape-typed, tape-borrowed
    • astral-yaml (0.0.8 / astral-yaml-serde 0.0.8): value, typed, borrowed
    • rapidyaml (v0.16.0): resolve-typed
    • fkyaml (v0.5.0): parse (DOM construction + O(1) root check, no extra traversal)
    • noyalib (0.0.63): value, typed, borrowed
    • fast-yaml-core (0.7.0): parse
    • saphyr (0.3.3): parse
    • serde-saphyr (2.2.0): serde-json (targets serde_json::Value), typed
    • yaml-rust2 (0.13.0): parse
    • yaml-serde (0.10.7): value, typed
  • YAML emission (speed & memory, verified by semantic round-trip oracle):
    • All 12 emitting libraries (ayaml, astral-yaml via flow-only astral_yaml_serde::to_string, rapidyaml, fkyaml, libyaml, libfyaml, noyalib, fast-yaml-core, saphyr, serde-saphyr from serde_json::Value, yaml-rust2, yaml-serde) across frontmatter-tiny, ci-workflow, openapi-spec, escape-routes, unicode-multibyte, lockfile-wide, and scale-openapi-100kb.

Mandatory pre-timing semantic oracle

Before any timing or allocation run starts, src/oracle.rs verifies that every parser's parsed output matches ayaml semantically across every supported fixture, that typed struct decodes produce identical Rust structs, and that every measured YAML emitter round-trips semantically identically through ayaml::parse_value. Silent semantic mismatches abort the benchmark immediately; genuine upstream capability gaps (e.g., single-document APIs on multi-doc streams, parsers rejecting explicit mapping keys, or fixture-specific upstream emitter incompatibilities) are recorded in structured exclusions[] inside schema-v2 fingerprint.json rather than silently mismeasured.

Quick start

# 1. Verify vendored C/C++ shims, allocation tracking, and full semantic oracle
cargo test --workspace --all-features --locked
python3 scripts/test_export_jsonl.py

# 2. Run 3 Criterion rounds + exact counting-allocator probe (pinned to CPU 2)
chmod +x scripts/run_benchmarks.sh
./scripts/run_benchmarks.sh --rounds 3 --cpu 2

# 3. Export canonical speed.jsonl, memory.jsonl, and schema-v2 fingerprint.json
python3 scripts/export_jsonl.py \
  --raw target/raw-capture \
  --out results/run

export_jsonl.py automatically extracts canonical peer_versions, harness_deps, vendored C/C++ pins from VENDOR.md, scenarios[] from ayaml-fixtures, and structured exclusions[] from competitive_mem --print-metadata. To benchmark a local ayaml checkout, pass --ayaml-path <path> to scripts/run_benchmarks.sh.

Vendored C/C++ peers

See crates/yaml-c-ffi/VENDOR.md for exact upstream versions, MIT licenses, SHA-256 checksums, and compiler flags.

License

Dual-licensed under Apache-2.0 or MIT (same as ayaml). Vendored C/C++ libraries retain their upstream MIT licenses.