Skip to content

Commit

Permalink
Update hex-simd expected output
Browse files Browse the repository at this point in the history
Previously, the `hex-simd` benchmark retrieved the bytes to hexify from
its own WebAssembly binary. This self-referential use was prone to
breakage any time the `benchmark.wasm` changed, like from building with
a new version of Rust. The `stdout.expected` file would immediately be
out of date. To fix this, this change randomly dumps 1MB of data into
`default.input` (as other benchmarks do) and uses this as the input to
hexify.
  • Loading branch information
abrown committed Jun 14, 2023
1 parent 2107830 commit 1462e79
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Binary file modified benchmarks/hex-simd/benchmark.wasm
Binary file not shown.
Binary file added benchmarks/hex-simd/default.input
Binary file not shown.
2 changes: 1 addition & 1 deletion benchmarks/hex-simd/rust-benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::arch::x86::*;
use std::arch::x86_64::*;

fn main() {
let input = std::fs::read("./benchmark.wasm").unwrap();
let input = std::fs::read("./default.input").unwrap();
let mut dst = vec![0; 2 * input.len()];
bench::start();
let s = hex_encode(&input, &mut dst).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hex-simd/stdout.expected

Large diffs are not rendered by default.

0 comments on commit 1462e79

Please sign in to comment.