Skip to content

Commit dc2cc99

Browse files
Updating union benchmark plot
1 parent 4101260 commit dc2cc99

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

bench/macro/lsm-tree-bench-unions.hs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ import Control.Monad.Trans.State.Strict (runState, state)
4646
import qualified Data.ByteString.Short as BS
4747
import qualified Data.Colour.SRGB as Color
4848
import qualified Data.Foldable as Fold
49-
import qualified Data.List as List
5049
import Data.IORef
50+
import qualified Data.List as List
5151
import Data.List.NonEmpty (NonEmpty (..))
5252
import qualified Data.List.NonEmpty as NE
5353
import Data.Maybe (fromMaybe)
@@ -74,8 +74,8 @@ import System.Mem (performMajorGC)
7474
import qualified System.Random as Random
7575
import qualified Text.ParserCombinators.ReadPrec as Lex
7676
import Text.Printf (printf)
77-
import Text.Read (Read (..))
7877
import qualified Text.Read as Lex
78+
import Text.Read (Read (..))
7979
import qualified Text.Read.Lex as Lex
8080

8181
import Database.LSMTree.Extras (groupsOfN)
@@ -576,6 +576,7 @@ doRun gopts opts = do
576576
indicesPhase1 = negate <$> reverse [ 0 .. tickCountPrefix ]
577577
indicesPhase2 = [ 1 .. tickCountMiddle ]
578578
indicesPhase3 = [ tickCountMiddle + 1 .. tickCountMiddle + tickCountSuffix ]
579+
indicesDomain = indicesPhase1 <> indicesPhase2 <> indicesPhase3
579580
PaymentRate paymentRate = payRate opts
580581
benchmarkIterations h
581582
| pipelined opts = pipelinedIterations h
@@ -670,12 +671,17 @@ doRun gopts opts = do
670671

671672
-- Generate a performance plot based on the benchmark results.
672673
Plot.toFile Plot.def (rootDir gopts <> "/" <> deriveFileNameForPlot gopts opts) $ do
674+
let colorD = Color.sRGB 0.875 1.0 0.125 `Plot.withOpacity` 0.625
675+
let colorE = Color.sRGB 0.625 1.0 0.875 `Plot.withOpacity` 0.5
676+
let plotTicks = filter (\x -> x `mod` 10 == 0) indicesDomain
677+
let plotAxisX = Plot.makeAxis
678+
(fmap (show . Plot.toValue))
679+
(fromIntegral <$> plotTicks, [], fromIntegral <$> plotTicks)
673680
Plot.layout_title .= "Incremental Unions Performance"
681+
Plot.layout_x_axis . Plot.laxis_override .= const plotAxisX
674682
Plot.layout_x_axis . Plot.laxis_override .= Plot.axisGridHide
675683
Plot.layout_x_axis . Plot.laxis_title .= "Credits supplied over time"
676684
Plot.layout_y_axis . Plot.laxis_title .= "Lookup access time"
677-
let colorD = Color.sRGB 0.875 1.0 0.125 `Plot.withOpacity` 0.5
678-
let colorE = Color.sRGB 0.625 1.0 0.875 `Plot.withOpacity` 0.5
679685
Plot.plot $ fillBetween colorD "Debt balance"
680686
[ (d,(0,v)) | (d, v) <- zip [1 :: Word .. ] balances ]
681687
Plot.plot $ fillBetween colorE "Extra credits"

0 commit comments

Comments
 (0)