Commit Graph

13 Commits

Author SHA1 Message Date
Ian Jackson c593b861a7 hashx_cachegrind: Fix black_box location 2023-08-23 10:36:33 +01:00
Ian Jackson f123200d0c hashx_cachegrind: Make mk_c_equix not shuffle the HashX 2023-08-23 10:36:33 +01:00
Ian Jackson 22d2ed9c98 hashx_cachegrind: Make mk_rust not shuffle the HashXBuilder 2023-08-23 10:36:33 +01:00
Ian Jackson 1f31ffd563 hashx_cachegrind: Introduce C_HASHX_OK alias 2023-08-23 10:36:33 +01:00
Ian Jackson ad59bfd28d hashx_cachegrind: Introduce bench_loop helper macro
The macro generates similar but not identical code.
There are new bindings.
2023-08-23 10:36:33 +01:00
Ian Jackson 71124ef351 hashx_cachegrind: Introduce u32be helper function
This is going to be more obviously useful in a moment.
2023-08-23 10:36:33 +01:00
Ian Jackson 7e1d0b7f45 hashx_cachegrind: Introduce mk_c_equix helper macro
The macro generates precisely the existing code.
2023-08-23 10:36:33 +01:00
Ian Jackson e7765ce969 hashx_cachegrind: Introduce mk_rust helper macro
The macro generates precisely the existing code.
2023-08-23 10:36:33 +01:00
Micah Elizabeth Scott 780e10e1d5 hashx/bench: Add cachegrind microbenchmarks
This uses the 'iai' crate and valgrind to measure fine grained cache
behavior during program generation and hash computation.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-18 20:09:40 -07:00
Micah Elizabeth Scott 550d89fb57 hashx/bench: Shared generate wrapper for u64-hash and full-hash
Code cleanup from review feedback

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:46 -07:00
Micah Elizabeth Scott 315122f159 hashx/bench, equix/bench: Enable debug symbols
Propagates this setting from the outer Cargo.toml to the new
benchmark crates, since they no longer get the setting by
being included in the main workspace.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:46 -07:00
Micah Elizabeth Scott 256e5de9e5 hashx/bench, equix/bench: check in matching Cargo.lock files
It might be useful to keep these locked down for benchmark
reproducibility. Currently the hashx and equix crates are
fully separate.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:46 -07:00
Micah Elizabeth Scott ae58ea0697 equix, hashx: Benchmark against C implementation
This is a small batch of improvements for the equix and hashx
benchmarks. The headline feature is that we are now including
the C implementations (slightly modified from tevador's, hosted
as part of c-tor) and using them in apples-to-apples comparisons.

Minor features:
- Benchmarks moved to new nested crates, preventing their
  dependencies from spilling into the main workspace build.
- Tests are now grouped
- We also test the performance of memory reuse where possible
- Code cleanup for per-runtime options

These benchmark builds will now automatically pull in the c-tor
git repo and build portions of it with a Rust wrapper. This uses
the 'cc' and 'bindgen' crates, so it requires a C compiler and
libclang on the host system.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
2023-08-01 19:28:43 -07:00