Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Firstyear committed Apr 10, 2021
1 parent d8ee2c8 commit 5509de3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
32 changes: 28 additions & 4 deletions benches/bench_idl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,39 @@ fn bench_duplex(c: &mut Criterion) {
vec2.push(64 * i + 15);
vec2.push(64 * i + 20);
vec2.push(64 * i + 25);
vec2.push(64 * i + 30);
vec2.push(64 * i + 35);
vec2.push(64 * i + 40);
vec2.push(64 * i + 45);
vec2.push(64 * i + 50);
}

let i = Duplex(vec1, vec2);
do_bench_duplex(c, "13_ludwig_sparse", i);

let mut vec1 = Vec::new();
for i in 1..300 {
vec1.push(64 * i + 5);
vec1.push(64 * i + 7);
vec1.push(64 * i + 15);
vec1.push(64 * i + 20);
vec1.push(64 * i + 25);
vec1.push(64 * i + 30);
vec1.push(64 * i + 35);
vec1.push(64 * i + 40);
vec1.push(64 * i + 45);
vec1.push(64 * i + 50);
}
let mut vec2 = Vec::new();
for i in 200..500 {
vec2.push(64 * i + 5);
vec2.push(64 * i + 7);
vec2.push(64 * i + 15);
vec2.push(64 * i + 20);
vec2.push(64 * i + 25);
vec2.push(64 * i + 30);
vec2.push(64 * i + 35);
}

let i = Duplex(vec1, vec2);
do_bench_duplex(c, "13_ludwig_sparse", i);
do_bench_duplex(c, "14_ludwig_sparse", i);
}

fn do_bench_triplex(c: &mut Criterion, label: &str, i: Triplex) {
Expand Down
6 changes: 5 additions & 1 deletion src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ use std::slice;
/// Default number of IDL ranges to keep in stack before we spill into heap. As many
/// operations in a system like kanidm are either single item indexes (think equality)
/// or very large indexes (think pres, class), we can keep this small.
const DEFAULT_SPARSE_ALLOC: usize = 5;
// was 5
const DEFAULT_SPARSE_ALLOC: usize = 2;
// const DEFAULT_COMP_ALLOC: usize = 2;
// const DEFAULT_SPARSE_ALLOC: usize = 5 + 8;
// const DEFAULT_COMP_ALLOC: usize = 2 + 4;


// 10 per range

/// The core representation of sets of integers in compressed format.
#[derive(Serialize, Deserialize, Debug, Clone)]
struct IDLRange {
Expand Down

0 comments on commit 5509de3

Please sign in to comment.