From 2d4bcf202f02aa7b01dac5c0aae08cf3c1afa985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20B=C3=B6ving?= Date: Mon, 18 Aug 2025 20:36:33 +0200 Subject: [PATCH] chore: even more independent benchmarks (#9970) --- tests/bench/hashmap.lean | 4 ++-- tests/bench/phashmap.lean | 4 ++-- tests/bench/treemap.lean | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/bench/hashmap.lean b/tests/bench/hashmap.lean index b33272fdb6..21065f5546 100644 --- a/tests/bench/hashmap.lean +++ b/tests/bench/hashmap.lean @@ -137,7 +137,7 @@ def benchInsertMissEmpty (seed : UInt64) (size : Nat) : IO Float := do while todo != 0 do let mut map : Std.HashMap _ _ := {} for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.size > size then throw <| .userError "Fail" todo := todo - size @@ -152,7 +152,7 @@ def benchInsertMissEmptyWithCapacity (seed : UInt64) (size : Nat) : IO Float := while todo != 0 do let mut map := Std.HashMap.emptyWithCapacity size for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.size > size then throw <| .userError "Fail" todo := todo - size diff --git a/tests/bench/phashmap.lean b/tests/bench/phashmap.lean index 967ed7340e..e08d29b940 100644 --- a/tests/bench/phashmap.lean +++ b/tests/bench/phashmap.lean @@ -120,7 +120,7 @@ def benchInsertMissEmpty (seed : UInt64) (size : Nat) : IO Float := do while todo != 0 do let mut map : Lean.PersistentHashMap _ _ := {} for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.isEmpty then throw <| .userError "Fail" todo := todo - size @@ -137,7 +137,7 @@ def benchInsertMissEmptyShared (seed : UInt64) (size : Nat) : IO Float := do let mut map : Lean.PersistentHashMap _ _ := {} let mut maps := Array.emptyWithCapacity size for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.isEmpty then throw <| .userError "Fail" maps := maps.push map diff --git a/tests/bench/treemap.lean b/tests/bench/treemap.lean index b1b242b5df..9ff6f1e98d 100644 --- a/tests/bench/treemap.lean +++ b/tests/bench/treemap.lean @@ -134,7 +134,7 @@ def benchInsertRandomMissEmpty (seed : UInt64) (size : Nat) : IO Float := do while todo != 0 do let mut map : Std.TreeMap UInt64 _ := {} for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.size > size then throw <| .userError "Fail" todo := todo - size @@ -149,7 +149,7 @@ def benchInsertSequentialMissEmpty (_seed : UInt64) (size : Nat) : IO Float := d while todo != 0 do let mut map : Std.TreeMap UInt64 _ := {} for val in [0:size] do - map := map.insert val.toUInt64 s!"{val}" + map := map.insert val.toUInt64 val if map.size > size then throw <| .userError "Fail" todo := todo - size @@ -166,7 +166,7 @@ def benchInsertRandomMissEmptyShared (seed : UInt64) (size : Nat) : IO Float := let mut map : Std.TreeMap UInt64 _ := {} let mut maps := Array.emptyWithCapacity size for val in iterRand seed |>.take size |>.allowNontermination do - map := map.insert val s!"{val}" + map := map.insert val val if map.isEmpty then throw <| .userError "Fail" maps := maps.push map