-
-
Save wereHamster/c399743135c332cc711c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Monad | |
import Data.Text (Text) | |
import Data.Aeson.Types (Value) | |
import qualified Database.RethinkDB as R | |
import Criterion.Main | |
createRethinkHandle :: IO R.RethinkDBHandle | |
createRethinkHandle = do | |
handle <- R.connect "localhost" 28015 Nothing | |
return $ R.use handle (R.db "test") | |
rawLookup :: R.RethinkDBHandle -> IO () | |
rawLookup handle = do | |
void (R.run handle $ R.get key table :: IO (Maybe Value)) | |
where | |
table = R.table "snapshots" | |
key = R.expr ("0ovUatO5oD@5" :: Text) | |
main :: IO () | |
main = do | |
handle <- createRethinkHandle | |
defaultMain [ bench "lookup" $ nfIO $ rawLookup handle ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment