Skip to content

[Benchmark] Validate phf dispatch threshold with end-to-end XML decoding #57

Open

Description

@nth-bailey

Context

PR #56 adds opt-in Rust --feature phf dispatch and a Criterion lookup benchmark. The benchmark and hardware-counter data in docs/benchmarks/rust-phf-dispatch.md suggest a crossover around 835 element names, but dispatch alone does not measure full XML decoding. The current compiler does not automatically choose phf at a schema-size threshold.

Investigate

  • Benchmark representative generated Rust XML decoders end to end, including tokenization, tag lookup, and field decoding, across small, medium, and large schemas. Compare default match dispatch with --feature phf using the same documents and tag distributions.
  • Record throughput in MB/s and elements/s, plus memory use and the hardware counters where available. Explain any difference from the lookup-only results.
  • Use [Benchmark] Large-schema compile-time & binary-size comparison (600/1500 elements) deferred from #49 #55's large-schema compile-time and size results when deciding whether an automatic threshold is worthwhile.
  • Decide whether phf remains explicit opt-in or becomes an automatic default above a measured threshold. If the latter, implement the selection, an override, documentation, and regression tests.

Related: #49, #55, PR #56.

Activity

  1. nth-bailey commented on Sep 27, 2026

    @nth-bailey
    CollaboratorAuthor

    Measured generated Rust XML decoders end to end on 16-field and 120-field schemas using the same documents for match and phf, with both measurement orders. On the September 2026 host, match was faster in both sizes, so there is no measured basis yet for an automatic threshold. Method, caveats, and raw samples: https://github.com/polyxml/PolyXML/blob/main/docs/benchmarks/rust-phf-dispatch.md . Keeping this issue open for the large-schema tier and threshold decision; #55 remains deferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions