Skip to content

Add a: setup --write-buffer-alloc flag to WP8 benchmark #772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions bench/macro/lsm-tree-bench-wp8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ data GlobalOpts = GlobalOpts

data SetupOpts = SetupOpts {
bloomFilterAlloc :: !LSM.BloomFilterAlloc
, writeBufferAlloc :: !LSM.WriteBufferAlloc
}
deriving stock Show

Expand All @@ -178,9 +179,15 @@ data Cmd
deriving stock Show

mkTableConfigSetup :: GlobalOpts -> SetupOpts -> LSM.TableConfig -> LSM.TableConfig
mkTableConfigSetup GlobalOpts{diskCachePolicy} SetupOpts{bloomFilterAlloc} conf = conf {
LSM.confDiskCachePolicy = diskCachePolicy
mkTableConfigSetup GlobalOpts{diskCachePolicy}
SetupOpts {
bloomFilterAlloc,
writeBufferAlloc
} conf =
conf {
LSM.confDiskCachePolicy = diskCachePolicy
, LSM.confBloomFilterAlloc = bloomFilterAlloc
, LSM.confWriteBufferAlloc = writeBufferAlloc
}

mkTableConfigRun :: GlobalOpts -> RunOpts -> LSM.TableConfig -> LSM.TableConfig
Expand Down Expand Up @@ -239,8 +246,24 @@ cmdP = O.subparser $ mconcat
]

setupOptsP :: O.Parser SetupOpts
setupOptsP = pure SetupOpts
<*> 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]")
setupOptsP =
pure SetupOpts
<*> 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]")

<*> LSM.AllocNumEntries `fmap` O.option
(O.auto)
(O.long "write-buffer-alloc" <>
O.value defaultAllocNumEntries <>
O.showDefault <>
O.help "Write buffer size")
where
LSM.AllocNumEntries defaultAllocNumEntries =
LSM.confWriteBufferAlloc LSM.defaultTableConfig

runOptsP :: O.Parser RunOpts
runOptsP = pure RunOpts
Expand Down