Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 2.65 KB

adding-your-smr.md

File metadata and controls

48 lines (31 loc) · 2.65 KB

Tl;dr

To add a new benchmark in smr-benchmark, you need to complete the following three tasks:

  1. (If necessary) Implement your SMR in ./smrs and define its dependency in ./Cargo.toml.
  2. Implement data structures in ./src/ds_impl/<your_smr>.
  3. Write the benchmark driver (a standalone binary for your SMR) in ./src/bin/<your_smr>.rs

Details

Implementing Your SMR

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.

Implementing Data Structures

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 test smoke in concurrent_map.rs (Example).
  • Implement your data structures according to the predefined ConcurrentMap trait (Example), and include a test function that invokes smoke internally (Example).

There is currently no convention for other types of data structures, such as queues.

Writing the Benchmark Driver

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.

Small Notes

  • 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).