Skip to content

Commit

Permalink
Foobar
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Apr 25, 2024
1 parent c8499be commit 5b05979
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bench/macro/lsm-tree-bench-wp8.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE OverloadedRecordDot #-}
{-# LANGUAGE OverloadedStrings #-}
Expand All @@ -8,6 +9,7 @@ module Main (main) where
import Control.Applicative ((<**>))
import Control.Exception (bracket)
import qualified Crypto.Hash.SHA256 as SHA256
import Control.Monad (forM_)
import qualified Data.Binary as B
import qualified Data.ByteString as BS
import Data.Void (Void)
Expand Down Expand Up @@ -111,7 +113,7 @@ timed_ action = do

-- https://input-output-hk.github.io/fs-sim
doSetup :: GlobalOpts -> SetupOpts -> IO ()
doSetup gopts _opts = do
doSetup gopts opts = do
let mountPoint :: FS.MountPoint
mountPoint = FS.MountPoint gopts.rootDir

Expand All @@ -124,7 +126,18 @@ doSetup gopts _opts = do
withSession someFs (FS.mkFsPath []) $ \session -> do
tbh <- LSM.new @IO @K @V @B session defaultTableConfig

-- TODO: insert data into initial table
forM_ [ 1 .. opts.size ] $ \ (fromIntegral -> i) -> do
-- TODO: this procedure simply inserts all the keys into initial lsm tree
-- We might want to do deletes, so there would be delete-insert pairs
-- Let's do that when we can actually test that benchmark works.

let k = makeKey i
let v = theValue

-- TODO: LSM.inserts has annoying order
flip LSM.inserts tbh
[ (k, v, Nothing)
]

LSM.snapshot name tbh

Expand Down

0 comments on commit 5b05979

Please sign in to comment.