Repository navigation
perf: add benchmark tooling and reduce fixed overhead - #5
Conversation
|
Thanks for the benchmark reproducibility work — the evidence pipeline and fixture matrix are valuable. One request before merge: please refactor the Python scripts under The PR currently adds several Happy to review a Rust port with the same functionality. Once that is in place, we can merge without a Python dependency. |
e2af135 to
cf9a7b5
Compare
|
I pushed a cleaned-up Rust-native version and force-updated the branch to keep the history reviewable. What changed since your review comment:
Latest generated evidence is One precision on WASM: this PR now provides a Rust-native Small non-blocking credit/contact note: #4 was a substantial contribution: GitHub reports Also, I noticed from your public profile/repos that you have several media-focused Rust projects besides Revelo, including |
|
Thanks — and happy to add you to the credits. One thing before merge: this PR bundles the dev tooling with a few parser output-semantics changes — dropping On reaching out — I don't use Telegram/Signal/Element/SimpleX, but I'm on WhatsApp if you'd like to connect there. |
Use libc time/localtime_r on Unix for local date fields and keep the date subprocess as a fallback. The CLI computes this per analyzed file, so avoiding process spawn removes fixed overhead without changing exported field shape.\n\nConstraint: Keep non-Unix fallback behavior unchanged.\nConfidence: high\nScope-risk: narrow\nTested: cargo fmt --all --check\nTested: cargo test -p revelo-parsers-tag parse_tags_\nTested: cargo test -p revelo-diff\nTested: cargo run -p revelo-bench -- self-test\nNot-tested: Full workspace gate not rerun yet after history rewrite.
Disable default features on internal parser dependencies so the WASM package can traverse the parser graph without accidentally enabling desktop-only core defaults.\n\nConstraint: Keep public crate defaults unchanged.\nConfidence: high\nScope-risk: moderate\nTested: RUSTC="/Users/else/.rustup/toolchains/1.95.0-aarch64-apple-darwin/bin/rustc" cargo check -p revelo-wasm --target wasm32-unknown-unknown
Generic tag scans are useful for standalone metadata/image-like files, but expensive after container parsers have already identified audio/video media. Gate only the expensive generic scans for known media containers and streams, while keeping unlisted formats on the legacy scan path so embedded metadata is not silently dropped.\n\nConstraint: Preserve embedded metadata scans for image streams and unlisted formats.\nRejected: Pure scan allowlist | too easy to drop metadata for an unlisted parser.\nConfidence: medium\nScope-risk: moderate\nTested: cargo test -p revelo-parsers-tag parse_tags_\nNot-tested: Full representative real-media oracle corpus remains summarized separately in target/oracle-parity.
Run computed fields, duplicate stream detection and generic tag parsing in revelo-diff before XML export. The maintainer requested oracle evidence for tag-scan changes, so the diff harness must exercise the same metadata path as the CLI.\n\nConstraint: Keep the existing MediaInfo XML comparison flow and strict mode.\nConfidence: medium\nScope-risk: moderate\nTested: cargo test -p revelo-diff\nTested: target/release/revelo-diff --strict target/oracle-parity/20260705-tags-gate/mp4-title.mp4
Provide a Rust-native benchmark pipeline for generated and local manifest-driven media cases, including fixture generation, Hyperfine comparison, perf probe records, HTML table rendering and optional Chrome CDP PNG capture. This replaces the earlier local Python prototype with workspace-native tooling.\n\nConstraint: Keep private media paths and raw outputs out of git.\nRejected: Python benchmark scripts | maintainer requested Rust-native tooling only.\nConfidence: high\nScope-risk: moderate\nTested: cargo run -p revelo-bench -- self-test\nTested: target/perf-investigation/20260704Tcurrent-rust-native-extended-v2/results.json generated before the review cleanup.\nNot-tested: Full benchmark matrix not rerun after removing non-performance parser semantics.
cf9a7b5 to
ec0d04c
Compare
|
I updated the branch for this review and force-pushed a cleaned history at What changed for the four parser-semantics items:
I also updated Representative
So the PR no longer carries the three unrelated parser-output changes, and the remaining performance change no longer has the risky “only scan listed formats” behavior. The strict oracle run is still not byte-equal for every generated row because these formats have existing output-fidelity gaps, but the I also updated the PR body to describe the review cleanup and to distinguish the latest full timing run ( Verification after the cleanup:
And yes, WhatsApp works for me. Since this is a public PR thread, I will avoid posting phone details here; use whichever non-public channel you prefer. |
|
Merged — thank you. This was a clean, thorough response: dropping the three unrelated parser-output changes, reworking You'll be in the release notes for the large-file work in #4 and this benchmark/perf work in the next release. On connecting: rather than swap contact details on a public thread, feel free to reach me at the email on my GitHub profile — happy to talk Rust media crates there. |
Summary
This follows up on #4 with Rust-native benchmark tooling plus the small constant-factor fixes found while investigating the remaining Revelo vs MediaInfo gap.
#4 made large-file parsing bounded and measurable. This PR keeps the follow-up focused on two things:
Runtime fixes included here:
date +%zon Unix for local file time formatting;Review cleanup after the maintainer feedback:
parse_rledetect-table change from this PR;moov-first QuickTime parser change from this PR;tags.rspolicy from a scan allowlist to a conservative skip policy: known audio/video/container outputs skip expensive generic embedded scans, but unlisted formats keep the legacy scan path;revelo-diffwith the CLI metadata path so the oracle harness now runs computed fields, duplicate-stream detection andparse_tags()before XML export.Current head after that cleanup is
ec0d04c.Rust-Native Tooling
This replaces the earlier Python prototype with:
crates/revelo-bench, a dev-only workspace binary withgenerate-fixtures,compare,render-table,evidenceandself-testsubcommands;crates/revelo-cli/examples/perf_probe.rs, a dev-only phase probe emitting line-oriented JSON;just bench-comparefor manifest-driven Hyperfine comparisons;just bench-evidencefor comparison plus table generation with one shared run id;just bench-compare-tableandjust bench-compare-pngfor regenerating HTML/PNG from existing sanitized JSON;just bench-wasmfor a Rust-nativerevelo-wasmbuild check onwasm32-unknown-unknown;scripts/perf/manifest.example.json,scripts/perf/manifest.extended.example.json,scripts/perf/table.config.example.jsonandscripts/perf/README.md.Generated fixtures, local real-media manifests, raw outputs and screenshots are not committed. Default output remains under
target/perf-investigation/andtarget/perf-fixtures/.The PNG path is optional:
revelo-benchrenders HTML/CSS fromresults.json, then captures that same HTML through a locally installed Chrome/Chromium/Edge via CDP. If no compatible browser is available, JSON/HTML still generate and the JSON records that PNG capture was skipped.Benchmark Evidence
Latest full generated run:
20260704Tcurrent-rust-native-extended-v2;cf9a7b5;ec0d04c;1.20.0;2warmups +10measured runs;0.4.6,0.5.0,0.5.1, this PR branch, MediaInfo and ffprobe;38generated sparse fixtures from the committed extended manifest;10.19 GiB, stored sparsely;26.5.1;rustc 1.96.0/cargo 1.96.0from Homebrew;26.05, ffprobe8.1.2.The post-review cleanup removed non-performance parser semantics and made the tag-scan policy more conservative for unlisted formats. The full 38-row timing matrix was not rerun after that cleanup; the benchmarked media cases remain known media container/audio/image rows that still take the bounded path.
Headline results from that run, median milliseconds:
337.0 ms654.0 ms3710.5 ms323.2 ms653.5 ms3658.1 ms17.7 ms19.0 ms25.5 ms2.6 ms3.4 ms7.7 ms8.6 ms14.5 ms119.8 ms21.4 ms27.7 ms1415.5 msAcross the generated matrix:
10 mson38/38rows;7.7 ms;0/38rows;0/38rows.The generated artifacts are local and uncommitted:
target/perf-investigation/20260704Tcurrent-rust-native-extended-v2/results.json;target/perf-investigation/20260704Tcurrent-rust-native-extended-v2/benchmark-table.png.One clarification about the previous #4 screenshot: that table was captured from a mid-review performance branch and an earlier benchmark pipeline. The new table measures the final published
v0.5.1release and this PR with the Rust-native pipeline on one shared manifest, so the fair comparison is inside this new run rather than row-by-row against the old screenshot.Oracle And WASM Notes
revelo-diffnow exercisesparse_tags()before XML export, so it can cover thetags.rsgating path.revelo-diffremains the right gate for parser output semantics. The review response below includes a small representative run for the remainingtags.rschange.just bench-wasm; it is not a browser or runtime timing benchmark.Verification
Local gates run on this branch after the review cleanup:
cargo fmt --all --check;cargo test --workspace --all-targets;cargo clippy --workspace --all-targets(passes with existing non-fatal warnings; CI does not use-D warnings);RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps;cargo build -p revelo-cli --examples --release;cargo build -p revelo-diff --release;cargo run -p revelo-bench -- self-test;RUSTC="$(rustup which rustc)" cargo check -p revelo-wasm --target wasm32-unknown-unknown;20260704Tcurrent-rust-native-extended-v2with2warmups +10runs, before the review cleanup described above.