Skip to content

Commit 610e9b7

Browse files
jeltschjorisdral
authored andcommitted
Make ordinary indexes the default
1 parent b0e047c commit 610e9b7

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

Diff for: bench/macro/lsm-tree-bench-wp8.hs

+10-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ import Database.LSMTree.Internal.ByteString (byteArrayToSBS)
7979
-- using only use public lsm-tree interface
8080
import qualified Database.LSMTree.Normal as LSM
8181

82+
-------------------------------------------------------------------------------
83+
-- Table configuration
84+
-------------------------------------------------------------------------------
85+
86+
benchTableConfig :: LSM.TableConfig
87+
benchTableConfig =
88+
LSM.defaultTableConfig {LSM.confFencePointerIndex = LSM.CompactIndex}
89+
8290
-------------------------------------------------------------------------------
8391
-- Keys and values
8492
-------------------------------------------------------------------------------
@@ -407,7 +415,7 @@ doSetup' gopts opts = do
407415
LSM.mkSnapshotName "bench"
408416

409417
LSM.withSession (mkTracer gopts) hasFS hasBlockIO (FS.mkFsPath []) $ \session -> do
410-
tbl <- LSM.new @IO @K @V @B session (mkTableConfigSetup gopts opts LSM.defaultTableConfig)
418+
tbl <- LSM.new @IO @K @V @B session (mkTableConfigSetup gopts opts benchTableConfig)
411419

412420
forM_ (groupsOfN 256 [ 0 .. initialSize gopts ]) $ \batch -> do
413421
-- TODO: this procedure simply inserts all the keys into initial lsm tree
@@ -576,7 +584,7 @@ doRun gopts opts = do
576584
-- reference version starts with empty (as it's not practical or
577585
-- necessary for testing to load the whole snapshot).
578586
tbl <- if check opts
579-
then LSM.new @IO @K @V @B session (mkTableConfigRun gopts LSM.defaultTableConfig)
587+
then LSM.new @IO @K @V @B session (mkTableConfigRun gopts benchTableConfig)
580588
else LSM.openSnapshot @IO @K @V @B session (mkTableConfigOverride gopts) label name
581589

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

Diff for: bench/micro/Bench/Database/LSMTree/Monoidal.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ instance Monoidal.ResolveValue V where
5555

5656
benchConfig :: Common.TableConfig
5757
benchConfig = Common.defaultTableConfig {
58-
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
58+
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
59+
, Common.confFencePointerIndex = Common.CompactIndex
5960
}
6061

6162
{-------------------------------------------------------------------------------

Diff for: bench/micro/Bench/Database/LSMTree/Normal.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ newtype B2 = B2 ShortByteString
6565

6666
benchConfig :: Common.TableConfig
6767
benchConfig = Common.defaultTableConfig {
68-
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
68+
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 20000)
69+
, Common.confFencePointerIndex = Common.CompactIndex
6970
}
7071

7172
{-------------------------------------------------------------------------------
@@ -232,7 +233,7 @@ benchInsertBatches =
232233
!batchSize = 256
233234

234235
_benchConfig :: Common.TableConfig
235-
_benchConfig = Common.defaultTableConfig {
236+
_benchConfig = benchConfig {
236237
Common.confWriteBufferAlloc = Common.AllocNumEntries (Common.NumEntries 1000)
237238
}
238239

Diff for: src/Database/LSMTree/Internal/Config.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ defaultTableConfig =
9292
, confSizeRatio = Four
9393
, confWriteBufferAlloc = AllocNumEntries (NumEntries 20_000)
9494
, confBloomFilterAlloc = defaultBloomFilterAlloc
95-
, confFencePointerIndex = CompactIndex
95+
, confFencePointerIndex = OrdinaryIndex
9696
, confDiskCachePolicy = DiskCacheAll
9797
, confMergeSchedule = defaultMergeSchedule
9898
}

Diff for: test/Test/Database/LSMTree/Internal/Snapshot/Codec/Golden.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ basicSnapshotTableType :: (ComponentAnnotation, SnapshotTableType)
169169
basicSnapshotTableType = head enumerateSnapshotTableType
170170

171171
basicTableConfig :: (ComponentAnnotation, TableConfig)
172-
basicTableConfig = ( fuseAnnotations $ "T0" : replicate 4 blank, defaultTableConfig)
172+
basicTableConfig = ( fuseAnnotations $ "T0" : replicate 4 blank
173+
, defaultTableConfig {confFencePointerIndex = CompactIndex}
174+
)
173175

174176
basicRunNumber :: RunNumber
175177
basicRunNumber = enumerateRunNumbers

Diff for: test/Test/Database/LSMTree/Internal/Snapshot/FS.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ prop_flipSnapshotBit (Positive (Small bufferSize)) es pickFileBit =
208208
namedSnapDir = namedSnapshotDir (SessionRoot root) snapName
209209

210210
conf = defaultTableConfig {
211-
confWriteBufferAlloc = AllocNumEntries (NumEntries bufferSize)
211+
confWriteBufferAlloc = AllocNumEntries (NumEntries bufferSize)
212+
, confFencePointerIndex = CompactIndex
212213
}
213214
es' = fmap (bimap serialiseKey (bimap serialiseValue serialiseBlob)) es
214215

0 commit comments

Comments
 (0)