Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks: report tx/s as elements/s #345

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/bench/benches/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ fn insert_1<DB: BenchDatabase, T: BenchTable + RandomTable>(
let id = format!("insert_1/{table_params}/load={load}");
let data = create_sequential::<T>(0xdeadbeef, load + 1, 1000);

// Each iteration performs one transaction.
g.throughput(criterion::Throughput::Elements(1));

g.bench_function(&id, |b| {
bench_harness(
b,
Expand Down Expand Up @@ -181,6 +184,9 @@ fn insert_bulk<DB: BenchDatabase, T: BenchTable + RandomTable>(
let id = format!("insert_bulk/{table_params}/load={load}/count={count}");
let data = create_sequential::<T>(0xdeadbeef, load + count, 1000);

// Each iteration performs one transaction, though it inserts many rows.
g.throughput(criterion::Throughput::Elements(1));

g.bench_function(&id, |b| {
bench_harness(
b,
Expand Down Expand Up @@ -217,6 +223,10 @@ fn iterate<DB: BenchDatabase, T: BenchTable + RandomTable>(

db.insert_bulk(table_id, data)?;

// Each iteration performs a single transaction,
// though it iterates across many rows.
g.throughput(criterion::Throughput::Elements(1));

g.bench_function(&id, |b| {
bench_harness(
b,
Expand Down Expand Up @@ -261,6 +271,9 @@ fn filter<DB: BenchDatabase, T: BenchTable + RandomTable>(

db.insert_bulk(&table_id, data.clone())?;

// Each iteration performs a single transaction.
g.throughput(criterion::Throughput::Elements(1));

// We loop through all buckets found in the sample data.
// This mildly increases variance on the benchmark, but makes "mean_result_count" more accurate.
// Note that all databases have EXACTLY the same sample data.
Expand Down Expand Up @@ -308,6 +321,9 @@ fn find<DB: BenchDatabase, T: BenchTable + RandomTable>(

db.insert_bulk(&table_id, data.clone())?;

// Each iteration performs a single transaction.
g.throughput(criterion::Throughput::Elements(1));

// We loop through all buckets found in the sample data.
// This mildly increases variance on the benchmark, but makes "mean_result_count" more accurate.
// Note that all benchmarks use exactly the same sample data.
Expand Down
Loading