Skip to content

Commit

Permalink
Adds an extra check on the config to make sure we don't have too many…
Browse files Browse the repository at this point in the history
… tasks while testing
  • Loading branch information
ryanzarick committed Feb 4, 2025
1 parent 2300395 commit 87ac922
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bench/src/bin/speed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use bench::{
speed::{db_backend, test_gen::TestGenV2},
};

use qmdb::def::IN_BLOCK_IDX_BITS;
use qmdb::def::OP_CREATE;
use qmdb::def::OP_DELETE;
use qmdb::def::OP_READ;
Expand Down Expand Up @@ -55,6 +56,12 @@ fn main() {
// Each changeset has ~10 operations (9 writes + 1 delete typically)
let ops_per_changeset = 10; //test_gen.num_ops_in_cset() as usize;
let tasks_per_block = args.ops_per_block / (args.changesets_per_task * ops_per_changeset);

// task_ids encoded the local task_id index in the first IN_BLOCK_IDX_BITS bits of a i64 and
// the height in the remaining bits. This just makes sure we don't overflow during testing.
if tasks_per_block >= (1 << IN_BLOCK_IDX_BITS) {
panic!("tasks_per_block {} is too large", tasks_per_block);
}
// Check that it divides evenly
if args.entry_count % args.ops_per_block != 0 {
panic!(
Expand Down

1 comment on commit 87ac922

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 87ac922 Previous: 6558ee5 Ratio
Inserts Throughput 361728.03254325315 ops/s 1334129.5774419396 ops/s 3.69

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.