@@ -33,9 +33,9 @@ benchmarks = bgroup "Bench.Database.LSMTree" [
33
33
benchLargeValueVsSmallValueBlob
34
34
, benchCursorScanVsRangeLookupScan
35
35
, benchInsertBatches
36
- , benchInsertsVsMupserts
37
- , benchLookupsInsertsVsMupserts
38
- , benchLookupInsertsVsLookupMupserts
36
+ , benchInsertsVsUpserts
37
+ , benchLookupsInsertsVsUpserts
38
+ , benchLookupInsertsVsLookupUpserts
39
39
]
40
40
41
41
{- ------------------------------------------------------------------------------
@@ -275,22 +275,22 @@ benchInsertBatches =
275
275
cleanupFiles (tmpDir, hfs, hbio)
276
276
277
277
{- ------------------------------------------------------------------------------
278
- Inserts vs. Mupserts
278
+ Inserts vs. Upserts
279
279
-------------------------------------------------------------------------------}
280
280
281
- -- | Compare inserts and mupserts . The logical contents of the resulting
281
+ -- | Compare inserts and upserts . The logical contents of the resulting
282
282
-- database are the same.
283
- benchInsertsVsMupserts :: Benchmark
284
- benchInsertsVsMupserts =
283
+ benchInsertsVsUpserts :: Benchmark
284
+ benchInsertsVsUpserts =
285
285
env (pure $ snd $ randomEntriesGrouped 800_000 250 ) $ \ ess ->
286
286
env (pure $ V. map mkInserts ess) $ \ inss ->
287
- bgroup " inserts-vs-mupserts " [
287
+ bgroup " inserts-vs-upserts " [
288
288
bench " inserts" $
289
289
withEmptyTable $ \ (_, _, _, _, t) ->
290
290
V. mapM_ (inserts t) inss
291
- , bench " mupserts " $
291
+ , bench " upserts " $
292
292
withEmptyTable $ \ (_, _, _, _, t) ->
293
- V. mapM_ (mupserts t) ess
293
+ V. mapM_ (upserts t) ess
294
294
]
295
295
where
296
296
withEmptyTable =
@@ -305,18 +305,18 @@ benchInsertsVsMupserts =
305
305
)
306
306
307
307
{- ------------------------------------------------------------------------------
308
- Lookups plus Inserts vs. Mupserts
308
+ Lookups plus Inserts vs. Upserts
309
309
-------------------------------------------------------------------------------}
310
310
311
- -- | Compare lookups+inserts to mupserts . The former costs 2 LSMT operations,
312
- -- while Mupserts only cost 1 LSMT operation. The number of operations do not
311
+ -- | Compare lookups+inserts to upserts . The former costs 2 LSMT operations,
312
+ -- while Upserts only cost 1 LSMT operation. The number of operations do not
313
313
-- directly translate to the number of I\/O operations, but one can assume that
314
- -- lookup+insert is roughly twice as costly as mupsert .
315
- benchLookupsInsertsVsMupserts :: Benchmark
316
- benchLookupsInsertsVsMupserts =
314
+ -- lookup+insert is roughly twice as costly as upsert .
315
+ benchLookupsInsertsVsUpserts :: Benchmark
316
+ benchLookupsInsertsVsUpserts =
317
317
env (pure $ snd $ randomEntriesGrouped 800_000 250 ) $ \ ess ->
318
318
env (pure $ V. map mkInserts ess) $ \ inss ->
319
- bgroup " lookups-inserts-vs-mupserts " [
319
+ bgroup " lookups-inserts-vs-upserts " [
320
320
bench " lookups-inserts" $
321
321
withTable inss $ \ (_, _, _, _, t) ->
322
322
-- Insert the same keys again, but we sum the existing values in
@@ -327,12 +327,12 @@ benchLookupsInsertsVsMupserts =
327
327
lrs <- lookups t (V. map fst es)
328
328
let ins' = V. zipWith f es lrs
329
329
inserts t ins'
330
- , bench " mupserts " $
330
+ , bench " upserts " $
331
331
withTable inss $ \ (_, _, _, _, t) ->
332
332
-- Insert the same keys again, but we sum the existing values in
333
333
-- the table with the values we are going to insert: submit
334
- -- mupserts with the insert values.
335
- V. forM_ ess $ \ es -> mupserts t es
334
+ -- upserts with the insert values.
335
+ V. forM_ ess $ \ es -> upserts t es
336
336
]
337
337
where
338
338
f (k, v) = \ case
@@ -353,20 +353,20 @@ benchLookupsInsertsVsMupserts =
353
353
)
354
354
355
355
{- ------------------------------------------------------------------------------
356
- Lookup Inserts vs. Lookup Mupserts
356
+ Lookup Inserts vs. Lookup Upserts
357
357
-------------------------------------------------------------------------------}
358
358
359
- -- | Compare lookups after inserts against lookups after mupserts .
360
- benchLookupInsertsVsLookupMupserts :: Benchmark
361
- benchLookupInsertsVsLookupMupserts =
359
+ -- | Compare lookups after inserts against lookups after upserts .
360
+ benchLookupInsertsVsLookupUpserts :: Benchmark
361
+ benchLookupInsertsVsLookupUpserts =
362
362
env (pure $ snd $ randomEntriesGrouped 80_000 250 ) $ \ ess ->
363
363
env (pure $ V. map mkInserts ess) $ \ inss ->
364
- bgroup " lookup-inserts-vs-lookup-mupserts " [
364
+ bgroup " lookup-inserts-vs-lookup-upserts " [
365
365
bench " lookup-inserts" $
366
366
withInsertTable inss $ \ (_, _, _, _, t) -> do
367
367
V. forM_ ess $ \ es -> lookups t (V. map fst es)
368
- , bench " lookup-mupserts " $
369
- withMupsertTable ess $ \ (_, _, _, _, t) -> do
368
+ , bench " lookup-upserts " $
369
+ withUpsertTable ess $ \ (_, _, _, _, t) -> do
370
370
V. forM_ ess $ \ es -> lookups t (V. map fst es)
371
371
]
372
372
where
@@ -387,14 +387,14 @@ benchLookupInsertsVsLookupMupserts =
387
387
cleanupFiles (tmpDir, hfs, hbio)
388
388
)
389
389
390
- withMupsertTable ess =
390
+ withUpsertTable ess =
391
391
perRunEnvWithCleanup
392
- -- Mupsert the same key 10 times. The results in a logical database
392
+ -- Upsert the same key 10 times. The results in a logical database
393
393
-- containing the original keys with the original value *10.
394
394
(do (tmpDir, hfs, hbio) <- mkFiles
395
395
(s, t) <- mkTable hfs hbio benchConfig
396
396
V. forM_ [1 .. 10 ] $ \ (_:: Int ) ->
397
- V. mapM_ (mupserts t) ess
397
+ V. mapM_ (upserts t) ess
398
398
pure (tmpDir, hfs, hbio, s, t)
399
399
)
400
400
(\ (tmpDir, hfs, hbio, s, t) -> do
0 commit comments