Skip to content

Commit

Permalink
bench(common): add more benchmark cases for unaligned number of keys (r…
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Apr 6, 2023
1 parent 3091f16 commit f80ef5d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/common/benches/bench_hash_key_encoding.rs
Expand Up @@ -232,6 +232,22 @@ fn case_builders() -> Vec<HashKeyBenchCaseBuilder> {
},
describe: "large mixed".to_string(),
},
// These benchmark cases will test unaligned key sizes.
// For instance five keys of Int64 cannot fit within Key256 (5 * 64 = 320 > 256),
// so it has to go to next largest keysize, Key512.
// This means 24 bytes of wasted memory.
HashKeyBenchCaseBuilder {
data_types: vec![DataType::Int64; 5],
describe: "unaligned small fixed".to_string(),
},
HashKeyBenchCaseBuilder {
data_types: vec![DataType::Int64; 9],
describe: "unaligned medium fixed".to_string(),
},
HashKeyBenchCaseBuilder {
data_types: vec![DataType::Int64; 17],
describe: "unaligned large fixed".to_string(),
},
]
}

Expand Down

0 comments on commit f80ef5d

Please sign in to comment.