To add a new benchmark in smr-benchmark
, you need to complete the following three tasks:
- (If necessary) Implement your SMR in
./smrs
and define its dependency in./Cargo.toml
. - Implement data structures in
./src/ds_impl/<your_smr>
. - Write the benchmark driver (a standalone binary for your SMR) in
./src/bin/<your_smr>.rs
Implement your SMR as a package in ./smrs
and define its dependency in ./Cargo.toml
. Alternatively, you can directly specify the dependency in Cargo.toml
using the crate.io registry or a GitHub repository.
Implement data structures in ./src/ds_impl/<your_smr>
. Follow this simple convention for the directory structure:
- Define a common trait for your
ConcurrentMap
implementation and its stress testsmoke
inconcurrent_map.rs
(Example). - Implement your data structures according to the predefined
ConcurrentMap
trait (Example), and include a test function that invokessmoke
internally (Example).
There is currently no convention for other types of data structures, such as queues.
The benchmark driver for map data structures (a standalone binary for your SMR) is located at ./src/bin/<your_smr>.rs
(Example). This will mostly be boilerplate code, so you should be able to write it easily by referring to existing examples.
Afterward, you can run a benchmark by:
cargo run --release --bin <your-smr> -- \
-d <data-structure> \
-t <threads> \
-g <get-rate> \
-r <key-range> \
-i <time-interval-to-run-seconds>
Please refer to README.md
or cargo run --bin <your-smr> -- -h
.
- To compile the suite, an x86 Ubuntu machine is required.
- This is because some SMRs depend on x86 Ubuntu (e.g., PEBR and HP++ use a modified
membarrier
, which is specifically optimized for x86 Ubuntu). - By removing these dependencies, you can compile and run the suite on other environments (e.g., AArch64 macOS).
- This is because some SMRs depend on x86 Ubuntu (e.g., PEBR and HP++ use a modified