@@ -110,7 +110,7 @@ benchLookupsInsertsVsMupserts :: Benchmark
110110benchLookupsInsertsVsMupserts =
111111 env (pure $ snd $ randomEntriesGrouped 800_000 250 ) $ \ ess -> bgroup " lookups-inserts-vs-mupserts" [
112112 env (pure $ V. map mkMonoidalInserts ess) $ \ inss -> bench " lookups-inserts" $
113- withNormalTable inss $ \ (_, _, _, _, t) ->
113+ withMonoidalTable inss $ \ (_, _, _, _, t) ->
114114 -- Insert the same keys again, but we sum the existing values in
115115 -- the table with the values we are going to insert: first lookup
116116 -- the existing values, sum those with the insert values, then
@@ -131,24 +131,10 @@ benchLookupsInsertsVsMupserts =
131131 Monoidal. NotFound -> (k, v)
132132 Monoidal. Found v' -> (k, v `resolve` v')
133133
134- withNormalTable inss =
135- perRunEnvWithCleanup
136- -- Make a monoidal table and fill it up
137- (do (tmpDir, hfs, hbio) <- mkFiles
138- (s, t) <- mkMonoidalTable hfs hbio benchConfig
139- V. mapM_ (flip Monoidal. inserts t) inss
140- pure (tmpDir, hfs, hbio, s, t)
141- )
142- (\ (tmpDir, hfs, hbio, s, t) -> do
143- cleanupMonoidalTable (s, t)
144- cleanupFiles (tmpDir, hfs, hbio)
145- )
146-
147- withMonoidalTable mupss = perRunEnvWithCleanup
134+ withMonoidalTable inss = perRunEnvWithCleanup
148135 -- Make a monoidal table and fill it up
149136 (do (tmpDir, hfs, hbio) <- mkFiles
150137 (s, t) <- mkMonoidalTable hfs hbio benchConfig
151- let inss = mupss -- conventiently, inserts and mupserts have the same format
152138 V. mapM_ (flip Monoidal. inserts t) inss
153139 pure (tmpDir, hfs, hbio, s, t)
154140 )
0 commit comments