rusticstuff / simdutf8

SIMD-accelerated UTF-8 validation for Rust.
Other
521 stars 25 forks source link

Benchmarking error #21

Closed chadbrewbaker closed 3 years ago

chadbrewbaker commented 3 years ago

Am I doing something stupid? Happy to add a PR to the docs on running the benchmark suite.

x86 WSL2 Ubuntu 20.04 environment using rust nightly toolchain

crb002@LAPTOP-PNLGM1UH:~/github/meta_coreutils/thirdparty/simdutf8/bench$ cargo bench
   Compiling simdutf8-bench v0.0.1 (/home/crb002/github/meta_coreutils/thirdparty/simdutf8/bench)
warning: unused import: `simdutf8_bench::define_cpb_benchmark`
 --> benches/cpb_simdjson.rs:1:5
  |
1 | use simdutf8_bench::define_cpb_benchmark;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `simdutf8_bench::define_throughput_benchmark`
 --> benches/throughput_simdjson.rs:1:5
  |
1 | use simdutf8_bench::define_throughput_benchmark;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0601]: `main` function not found in crate `throughput_simdjson`
 --> benches/throughput_simdjson.rs:1:1
  |
1 | / use simdutf8_bench::define_throughput_benchmark;
2 | |
3 | | #[cfg(feature = "simdjson")]
4 | | define_throughput_benchmark!(BenchFn::Simdjson);
  | |________________________________________________^ consider adding a `main` function to `benches/throughput_simdjson.rs`

error[E0601]: `main` function not found in crate `cpb_simdjson`
 --> benches/cpb_simdjson.rs:1:1
  |
1 | / use simdutf8_bench::define_cpb_benchmark;
2 | |
3 | | #[cfg(feature = "simdjson")]
4 | | define_cpb_benchmark!(BenchFn::Simdjson);
  | |_________________________________________^ consider adding a `main` function to `benches/cpb_simdjson.rs`

error: aborting due to previous error; 1 warning emitted

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0601`.
For more information about this error, try `rustc --explain E0601`.
error: could not compile `simdutf8-bench`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
hkratz commented 3 years ago

To benchmark the different implementations use:

Adding -- --save-baseline some_name to the bench commandline and then using critcmp to compare benchmarks is handy as well.

I don't really use the cpb_ (cycles-per-byte) benchmarks at the moment. I will add some documentation and make cargo bench do something useful or at least point to the docs.