Skip to content

Commit 2d55f19

Browse files
committed
WP8 benchmark: use small merge batch size in pipelined mode
This now gets real parallel speedups on the WP8 benchmark in pipelined mode. On my laptop, we get: * non-pipelined mode: 86.5k * before: pipelined mode (2 cores): 92.2k * after: pipelined mode (2 cores): 120.0k In part this is because pipelined mode on 1 core is a regression: 70.1k because it has to do strictly more work, and it avoids doing any batching which normally improves performance.
1 parent 4bfd1cf commit 2d55f19

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bench/macro/lsm-tree-bench-wp8.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,13 @@ mkTableConfigRun GlobalOpts{diskCachePolicy} conf = conf {
185185
LSM.confDiskCachePolicy = diskCachePolicy
186186
}
187187

188-
mkOverrideDiskCachePolicy :: GlobalOpts -> LSM.TableConfigOverride
189-
mkOverrideDiskCachePolicy GlobalOpts{diskCachePolicy} =
188+
mkOverrideDiskCachePolicy :: GlobalOpts -> RunOpts -> LSM.TableConfigOverride
189+
mkOverrideDiskCachePolicy GlobalOpts{diskCachePolicy} RunOpts {pipelined} =
190190
LSM.noTableConfigOverride {
191-
LSM.overrideDiskCachePolicy = Just diskCachePolicy
191+
LSM.overrideDiskCachePolicy = Just diskCachePolicy,
192+
LSM.overrideMergeBatchSize = if pipelined
193+
then Just (LSM.MergeBatchSize 1)
194+
else Nothing
192195
}
193196

194197
mkTracer :: GlobalOpts -> Tracer IO LSM.LSMTreeTrace
@@ -587,7 +590,7 @@ doRun gopts opts = do
587590
tbl <- if check opts
588591
then let conf = mkTableConfigRun gopts benchTableConfig
589592
in LSM.newTableWith @IO @K @V @B conf session
590-
else let conf = mkOverrideDiskCachePolicy gopts
593+
else let conf = mkOverrideDiskCachePolicy gopts opts
591594
in LSM.openTableFromSnapshotWith @IO @K @V @B conf session name label
592595

593596
-- In checking mode, compare each output against a pure reference.

0 commit comments

Comments
 (0)