feat(cli): move benchmark orchestration into Rust
The C benchmark translation unit still contained the complete BMK implementation, so program builds and paramgrill could silently keep using a second C implementation even though rust/src/benchzstd.rs already provided the same ABI. Replace that duplicate with a declaration-only shim and retain compile-time checks for the by-value result and parameter layouts. The standalone test tools do not link the full CLI archive. Keep their helpers archive free of the benchmark and trace-only objects, and add a separate benchmark archive for paramgrill so the shim remains linkable without pulling program-only trace dependencies into datagen and similar targets. Test Plan: - `cargo test --manifest-path rust/cli/Cargo.toml --no-default-features --features cli,compression,decompression,benchmark,dict-builder --lib -- --test-threads=1` -- 165 passed - `make -B -C programs -j2 zstd` -- passed - `./programs/zstd -b1 tests/hello` -- passed - `make -B -C tests paramgrill` -- passed - `./tests/paramgrill -S tests/hello` -- passed - `make -C tests -j2 test-fullbench` -- passed - targeted Rust clippy and nightly rustfmt checks -- passed - full all-target clippy remains blocked by pre-existing test-only lints in `zstd_compress.rs` and `fileio_backend.rs`
This commit is contained in:
+2
-1
@@ -1,7 +1,7 @@
|
||||
#[cfg(any(feature = "benchmark", feature = "helpers"))]
|
||||
#[path = "../../src/benchfn.rs"]
|
||||
mod benchfn;
|
||||
#[cfg(all(feature = "cli", feature = "benchmark"))]
|
||||
#[cfg(feature = "benchmark")]
|
||||
#[path = "../../src/benchzstd.rs"]
|
||||
mod benchzstd;
|
||||
#[cfg(any(feature = "benchmark", feature = "helpers"))]
|
||||
@@ -26,5 +26,6 @@ mod util;
|
||||
#[cfg(feature = "cli")]
|
||||
#[path = "../../src/zstd_cli.rs"]
|
||||
mod zstd_cli;
|
||||
#[cfg(feature = "cli")]
|
||||
#[path = "../../src/zstdcli_trace.rs"]
|
||||
mod zstdcli_trace;
|
||||
|
||||
Reference in New Issue
Block a user