Skip to content

Commit

Permalink
doc, examples: revise docs and move examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdroychan committed Jul 25, 2024
1 parent ba2f15d commit 78032c8
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 12 deletions.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
[package]
name = "kvbench"
version = "0.1.0"
authors = ["Chen Chen <mail@roychan.org>"]
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"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/mixed/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/readpopular/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion examples/writeheavy/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>,

/// How many times this benchmark will be repeated. Default 1.
/// How many times this benchmark will be repeated. Default: 1.
pub repeat: Option<usize>,

/// How long this benchmark will run, unit is seconds. If this option is specified, the `ops`
Expand All @@ -130,13 +130,13 @@ pub struct BenchmarkOpt {
/// - "all": equals to "repeat" + "finish".
pub report: Option<String>,

/// 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<usize>,

/// Batch size for each request (async only).
/// Batch size for each request Only useful with [`AsyncKVMap`]. Default: 1.
pub batch: Option<usize>,

/// The definition of a workload.
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 78032c8

Please sign in to comment.