Skip to content

Commit cfd9b19

Browse files
authored
Merge pull request #772 from IntersectMBO/dcoutts/wp8-configurable-write-buffer
Add a: setup --write-buffer-alloc flag to WP8 benchmark
2 parents a61fc43 + 6ea2784 commit cfd9b19

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

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

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ data GlobalOpts = GlobalOpts
153153

154154
data SetupOpts = SetupOpts {
155155
bloomFilterAlloc :: !LSM.BloomFilterAlloc
156+
, writeBufferAlloc :: !LSM.WriteBufferAlloc
156157
}
157158
deriving stock Show
158159

@@ -178,9 +179,15 @@ data Cmd
178179
deriving stock Show
179180

180181
mkTableConfigSetup :: GlobalOpts -> SetupOpts -> LSM.TableConfig -> LSM.TableConfig
181-
mkTableConfigSetup GlobalOpts{diskCachePolicy} SetupOpts{bloomFilterAlloc} conf = conf {
182-
LSM.confDiskCachePolicy = diskCachePolicy
182+
mkTableConfigSetup GlobalOpts{diskCachePolicy}
183+
SetupOpts {
184+
bloomFilterAlloc,
185+
writeBufferAlloc
186+
} conf =
187+
conf {
188+
LSM.confDiskCachePolicy = diskCachePolicy
183189
, LSM.confBloomFilterAlloc = bloomFilterAlloc
190+
, LSM.confWriteBufferAlloc = writeBufferAlloc
184191
}
185192

186193
mkTableConfigRun :: GlobalOpts -> RunOpts -> LSM.TableConfig -> LSM.TableConfig
@@ -239,8 +246,24 @@ cmdP = O.subparser $ mconcat
239246
]
240247

241248
setupOptsP :: O.Parser SetupOpts
242-
setupOptsP = pure SetupOpts
243-
<*> O.option O.auto (O.long "bloom-filter-alloc" <> O.value (LSM.confBloomFilterAlloc LSM.defaultTableConfig) <> O.showDefault <> O.help "Bloom filter allocation method [AllocFixed n | AllocRequestFPR d]")
249+
setupOptsP =
250+
pure SetupOpts
251+
<*> O.option
252+
O.auto
253+
(O.long "bloom-filter-alloc" <>
254+
O.value (LSM.confBloomFilterAlloc LSM.defaultTableConfig) <>
255+
O.showDefault <>
256+
O.help "Bloom filter allocation method [AllocFixed n | AllocRequestFPR d]")
257+
258+
<*> LSM.AllocNumEntries `fmap` O.option
259+
(O.auto)
260+
(O.long "write-buffer-alloc" <>
261+
O.value defaultAllocNumEntries <>
262+
O.showDefault <>
263+
O.help "Write buffer size")
264+
where
265+
LSM.AllocNumEntries defaultAllocNumEntries =
266+
LSM.confWriteBufferAlloc LSM.defaultTableConfig
244267

245268
runOptsP :: O.Parser RunOpts
246269
runOptsP = pure RunOpts

0 commit comments

Comments
 (0)