Skip to content

Commit adec249

Browse files
committed
Pin the hash seed in the execution benchmark harness
1 parent 0e9fa62 commit adec249

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎benches/execution.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ fn bench_rustpython_code(b: &mut Bencher<'_>, name: &str, source: &str) {
4444
settings.path_list.push("Lib/".to_string());
4545
settings.write_bytecode = false;
4646
settings.user_site_directory = false;
47+
// Pin the str/bytes hash secret so dict/set probe sequences (and thus
48+
// timings) are reproducible across benchmark runs.
49+
settings.hash_seed = Some(0);
4750
let builder = Interpreter::builder(settings);
4851
let defs = rustpython_stdlib::stdlib_module_defs(&builder.ctx);
4952
builder.add_native_modules(&defs).build().enter(|vm| {

0 commit comments

Comments
 (0)