@@ -46,8 +46,8 @@ import Control.Monad.Trans.State.Strict (runState, state)
46
46
import qualified Data.ByteString.Short as BS
47
47
import qualified Data.Colour.SRGB as Color
48
48
import qualified Data.Foldable as Fold
49
- import qualified Data.List as List
50
49
import Data.IORef
50
+ import qualified Data.List as List
51
51
import Data.List.NonEmpty (NonEmpty (.. ))
52
52
import qualified Data.List.NonEmpty as NE
53
53
import Data.Maybe (fromMaybe )
@@ -74,8 +74,8 @@ import System.Mem (performMajorGC)
74
74
import qualified System.Random as Random
75
75
import qualified Text.ParserCombinators.ReadPrec as Lex
76
76
import Text.Printf (printf )
77
- import Text.Read (Read (.. ))
78
77
import qualified Text.Read as Lex
78
+ import Text.Read (Read (.. ))
79
79
import qualified Text.Read.Lex as Lex
80
80
81
81
import Database.LSMTree.Extras (groupsOfN )
@@ -576,6 +576,7 @@ doRun gopts opts = do
576
576
indicesPhase1 = negate <$> reverse [ 0 .. tickCountPrefix ]
577
577
indicesPhase2 = [ 1 .. tickCountMiddle ]
578
578
indicesPhase3 = [ tickCountMiddle + 1 .. tickCountMiddle + tickCountSuffix ]
579
+ indicesDomain = indicesPhase1 <> indicesPhase2 <> indicesPhase3
579
580
PaymentRate paymentRate = payRate opts
580
581
benchmarkIterations h
581
582
| pipelined opts = pipelinedIterations h
@@ -670,12 +671,17 @@ doRun gopts opts = do
670
671
671
672
-- Generate a performance plot based on the benchmark results.
672
673
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)
673
680
Plot. layout_title .= " Incremental Unions Performance"
681
+ Plot. layout_x_axis . Plot. laxis_override .= const plotAxisX
674
682
Plot. layout_x_axis . Plot. laxis_override .= Plot. axisGridHide
675
683
Plot. layout_x_axis . Plot. laxis_title .= " Credits supplied over time"
676
684
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
679
685
Plot. plot $ fillBetween colorD " Debt balance"
680
686
[ (d,(0 ,v)) | (d, v) <- zip [1 :: Word .. ] balances ]
681
687
Plot. plot $ fillBetween colorE " Extra credits"
0 commit comments