Skip to content

perf: codec: av1/metadata and av1/metadata_itu_t35 are 1.12–1.21x the C, above the 1.10x bound #3175

Closed

Description

@vpacher

Part of #1295; found in the #1305 re-check of the #1295 inventory.

What

After #1304, the two AV1 metadata cases are still above the 1.10x Rust/C bound. All other rows of the #1295 inventory are inside it now (#1305).

rust/tools/benchmarks/record.py, master 538e920, Ryzen 9 5950X (Linux x86_64 LXC), pinned to one CPU, 5 passes, no profiling flags (RUSTFLAGS and CFLAGS empty; the oracle C at -O2 -ffp-contract=off -fno-strict-aliasing), Rust 1.98.1, GCC 14.2.0:

Run Case Rust ns C ns Rust/C paired run ratios
full suite av1/metadata 39.734 35.440 1.121 1.111–1.185
full suite av1/metadata_itu_t35 39.238 35.958 1.091 0.993–1.162
--category av1 av1/metadata 34.80 28.78 1.209 1.186–1.218
--category av1 av1/metadata_itu_t35 34.15 28.48 1.199 1.176–1.227

The absolute cost is about 4–6 ns per call (one metadata OBU per call). The 10-17 inventory had these at 1.506 and 1.367 on a Ryzen 7 3700X; #1304 removed the extra allocation and copy.

Proposed

Find the remaining difference before choosing between a fix and an exemption in BOUND_EXEMPTIONS (as #3138 decided for audio_mix/buffering_add_one_tick). A first step: perf annotate of the Rust core with its shim and of the C function in the bench binary, at these two cases.

Acceptance: record.py --category av1 --max-ratio 1.10 passes on a quiet host, or the maintainer records an exemption with the measured cost.

Activity

  1. vpacher commented on Oct 31, 2026

    @vpacher
    MemberAuthor

    Claiming: #3175

    Plan:

    1. Find the cause: perf annotate of the Rust core with its shim and of the C function in the port_comparison bench binary, at the two cases, on the same host as the numbers in the issue.
    2. If it is a fixable difference: one PR, RED (the two cases with record.py --category av1 --max-ratio 1.10, plus a deterministic test if the cause allows one) then GREEN, with Tier 3 parity unchanged.
    3. If the remaining cost is the FFI boundary itself (as in perf: audio_mix/buffering_add_one_tick is 1.19-1.30x the C, above the 1.10x bound #3138): a comment here with the measurement and a proposed BOUND_EXEMPTIONS entry, for a maintainer decision.

    First result here within a day.

  2. added
    ready
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions