From 78032c875bb64374805e678f044dc5119349be21 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Wed, 24 Jul 2024 23:43:37 -0500 Subject: [PATCH] doc, examples: revise docs and move examples --- Cargo.toml | 9 ++++++++- README.md | 4 ++-- {presets/benchmarks => examples/mixed}/mixed.toml | 0 examples/mixed/run.sh | 2 +- .../benchmarks => examples/readpopular}/readpopular.toml | 0 examples/readpopular/run.sh | 2 +- examples/writeheavy/run.sh | 2 +- .../benchmarks => examples/writeheavy}/writeheavy.toml | 0 src/bench.rs | 8 ++++---- src/lib.rs | 4 ++-- 10 files changed, 19 insertions(+), 12 deletions(-) rename {presets/benchmarks => examples/mixed}/mixed.toml (100%) rename {presets/benchmarks => examples/readpopular}/readpopular.toml (100%) rename {presets/benchmarks => examples/writeheavy}/writeheavy.toml (100%) diff --git a/Cargo.toml b/Cargo.toml index 187c871..b565271 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,15 @@ [package] name = "kvbench" version = "0.1.0" +authors = ["Chen Chen "] +description = "A key-value store benchmark framework with customizable workloads" edition = "2021" -exclude = ["presets", "examples"] +readme = "README.md" +repository = "https://www.github.com/nerdroychan/kvbench" +license-file = "LICENSE" +keywords = ["benchmark", "key-value"] +categories = ["concurrency", "development-tools::profiling", "development-tools::testing"] +exclude = ["examples"] [dependencies] ahash = "0.8.11" diff --git a/README.md b/README.md index 53fdf03..9a5e667 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![GitHub Workflow](https://github.com/nerdroychan/kvbench/actions/workflows/test.yml/badge.svg) ![GPLv3](https://img.shields.io/github/license/nerdroychan/kvbench) -A benchmarking framework designed for testing key-value stores with easily customizable +A benchmark framework designed for testing key-value stores with easily customizable workloads. ## Introduction @@ -14,7 +14,7 @@ in TOML-formatted files. The built-in command line interface is capable of loadi running the benchmarks as specified. In addition to standard single-process benchmarks, it also seamlessly incorporates a key-value -client/server setup that operates with a dedicated server thread or machine. +client/server implementation that operates with a dedicated server thread or machine. ## Usage diff --git a/presets/benchmarks/mixed.toml b/examples/mixed/mixed.toml similarity index 100% rename from presets/benchmarks/mixed.toml rename to examples/mixed/mixed.toml diff --git a/examples/mixed/run.sh b/examples/mixed/run.sh index 4b76da9..7fbf720 100755 --- a/examples/mixed/run.sh +++ b/examples/mixed/run.sh @@ -5,7 +5,7 @@ DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" cargo build --profile release-lto STORE_DIR=$DIR/../../presets/stores -BENCHMARK=$DIR/../../presets/benchmarks/mixed.toml +BENCHMARK=$DIR/mixed.toml STORES="chashmap contrie dashmap flurry papaya scchashmap mutex_hashmap rwlock_hashmap" diff --git a/presets/benchmarks/readpopular.toml b/examples/readpopular/readpopular.toml similarity index 100% rename from presets/benchmarks/readpopular.toml rename to examples/readpopular/readpopular.toml diff --git a/examples/readpopular/run.sh b/examples/readpopular/run.sh index 288e39a..aab540f 100755 --- a/examples/readpopular/run.sh +++ b/examples/readpopular/run.sh @@ -5,7 +5,7 @@ DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" cargo build --profile release-lto STORE_DIR=$DIR/../../presets/stores -BENCHMARK=$DIR/../../presets/benchmarks/readpopular.toml +BENCHMARK=$DIR/readpopular.toml STORES="chashmap contrie dashmap flurry papaya scchashmap mutex_hashmap rwlock_hashmap" diff --git a/examples/writeheavy/run.sh b/examples/writeheavy/run.sh index d1f80fb..0601716 100755 --- a/examples/writeheavy/run.sh +++ b/examples/writeheavy/run.sh @@ -5,7 +5,7 @@ DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" cargo build --profile release-lto STORE_DIR=$DIR/../../presets/stores -BENCHMARK=$DIR/../../presets/benchmarks/writeheavy.toml +BENCHMARK=$DIR/writeheavy.toml STORES="chashmap contrie dashmap flurry papaya scchashmap mutex_hashmap rwlock_hashmap" diff --git a/presets/benchmarks/writeheavy.toml b/examples/writeheavy/writeheavy.toml similarity index 100% rename from presets/benchmarks/writeheavy.toml rename to examples/writeheavy/writeheavy.toml diff --git a/src/bench.rs b/src/bench.rs index a7880ef..361ec71 100644 --- a/src/bench.rs +++ b/src/bench.rs @@ -104,10 +104,10 @@ enum ReportMode { /// set for them. #[derive(Deserialize, Clone, Debug)] pub struct BenchmarkOpt { - /// Number of threads that runs this benchmark. Default 1. + /// Number of threads that runs this benchmark. Default: 1. pub threads: Option, - /// How many times this benchmark will be repeated. Default 1. + /// How many times this benchmark will be repeated. Default: 1. pub repeat: Option, /// How long this benchmark will run, unit is seconds. If this option is specified, the `ops` @@ -130,13 +130,13 @@ pub struct BenchmarkOpt { /// - "all": equals to "repeat" + "finish". pub report: Option, - /// Max depth of queue for each worker (async only). + /// Max depth of queue for each worker. Only useful with [`AsyncKVMap`]. Default: 1. /// /// When the pending requests are less than `qd`, the worker will not attempt to get more /// responses. pub qd: Option, - /// Batch size for each request (async only). + /// Batch size for each request Only useful with [`AsyncKVMap`]. Default: 1. pub batch: Option, /// The definition of a workload. diff --git a/src/lib.rs b/src/lib.rs index 3e48897..5a4ecee 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! A benchmarking framework designed for testing key-value stores with easily customizable +//! A benchmark framework designed for testing key-value stores with easily customizable //! workloads. //! //! With `kvbench`, you can define the details of a benchmark using the TOML format, such as the @@ -11,7 +11,7 @@ //! trait, depending on the type of the store. After registering your store, simply reuse the //! exported [`cmdline()`] in your `main` function and it will work seamlessly with your own store. //! -//! A few noteworthy design choices include: +//! A few key design choices include: //! //! - Each key-value store exclusively stores a single type of key/value pair: variable-sized byte //! arrays represented as [`u8`] slices on the heap. No generics over the key's type.