diff --git a/benches/microbenchmarks.rs b/benches/microbenchmarks.rs index 1c3bfea55a3..7909c8e445e 100644 --- a/benches/microbenchmarks.rs +++ b/benches/microbenchmarks.rs @@ -107,6 +107,9 @@ fn bench_rustpython_code(group: &mut BenchmarkGroup<'_, WallTime>, bench: &Micro settings.path_list.push("Lib/".to_string()); settings.write_bytecode = false; settings.user_site_directory = false; + // Pin the str/bytes hash secret so dict/set probe sequences (and thus + // timings) are reproducible across benchmark runs. + settings.hash_seed = Some(0); let builder = Interpreter::builder(settings); let defs = rustpython_stdlib::stdlib_module_defs(&builder.ctx);