-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sut): add benchmark for zero copy variant
- Loading branch information
1 parent
48e3431
commit 41851b1
Showing
4 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Main where | ||
|
||
import Dumblog.ZeroCopy.Main (zeroCopyDumblog) | ||
|
||
import Common | ||
|
||
------------------------------------------------------------------------ | ||
|
||
main :: IO () | ||
main = commonMain "ZeroCopy" (zeroCopyDumblog bUFFER_CAPACITY pORT . Just) |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
module Dumblog.ZeroCopy.Main where | ||
|
||
import Journal.Types (Journal) | ||
import Control.Concurrent (MVar) | ||
import Journal.Types (oTermBufferLength) | ||
import Journal (defaultOptions, allocateJournal, startJournal) | ||
|
||
import Dumblog.ZeroCopy.HttpServer | ||
|
||
------------------------------------------------------------------------ | ||
|
||
zeroCopyDumblog :: Journal -> Int -> IO () | ||
zeroCopyDumblog jour port = httpServer jour port | ||
|
||
main :: IO () | ||
main = do | ||
zeroCopyDumblog :: Int -> Int -> Maybe (MVar ()) -> IO () | ||
zeroCopyDumblog capacity port mReady = do | ||
let fp = "/tmp/dumblog-zero-copy.journal" | ||
opts = defaultOptions | ||
opts = defaultOptions { oTermBufferLength = capacity } | ||
allocateJournal fp opts | ||
jour <- startJournal fp opts | ||
zeroCopyDumblog jour 8054 | ||
httpServer jour port mReady | ||
|
||
main :: IO () | ||
main = zeroCopyDumblog (64 * 1024) 8054 Nothing |