3
3
4
4
-- | This module contains benchmarks for Peras chain weight calculation as
5
5
-- implemented by the by the
6
- -- 'Ouroboros.Consensus.Peras.Weight.boostedWeightForFragment ' function.
6
+ -- 'Ouroboros.Consensus.Peras.Weight.weightBoostOfFragment ' function.
7
7
--
8
8
-- We benchmark the calculation on a static sequence of chain fragments of increasing
9
9
-- length, ranging from 0 to around 8640, with a sampling rate of 100. The chain fragments
@@ -16,8 +16,8 @@ import Numeric.Natural (Natural)
16
16
import Ouroboros.Consensus.Block (PerasWeight (PerasWeight ), SlotNo (.. ))
17
17
import Ouroboros.Consensus.Peras.Weight
18
18
( PerasWeightSnapshot
19
- , boostedWeightForFragment
20
19
, mkPerasWeightSnapshot
20
+ , weightBoostOfFragment
21
21
)
22
22
import Ouroboros.Network.AnchoredFragment qualified as AF
23
23
import Test.Ouroboros.Storage.TestBlock (TestBlock (.. ), TestBody (.. ), TestHeader (.. ))
@@ -49,7 +49,7 @@ benchmarkParams =
49
49
50
50
main :: IO ()
51
51
main =
52
- Test.Tasty.Bench. defaultMain $ map benchBoostedWeightForFragment inputs
52
+ Test.Tasty.Bench. defaultMain $ map benchWeightBoostOfFragment inputs
53
53
where
54
54
-- NOTE: we do not use the 'env' combinator to set up the test data since
55
55
-- it requires 'NFData' for 'AF.AnchoredFragment'. While the necessary
@@ -62,11 +62,11 @@ main =
62
62
zip [0 .. ] $
63
63
zip (map uniformWeightSnapshot fragments) fragments
64
64
65
- benchBoostedWeightForFragment ::
65
+ benchWeightBoostOfFragment ::
66
66
(Natural , (PerasWeightSnapshot TestBlock , AF. AnchoredFragment TestBlock )) -> Benchmark
67
- benchBoostedWeightForFragment (i, (weightSnapshot, fragment)) =
68
- bench (" boostedWeightForFragment of length " <> show i) $
69
- whnf (boostedWeightForFragment weightSnapshot) fragment
67
+ benchWeightBoostOfFragment (i, (weightSnapshot, fragment)) =
68
+ bench (" weightBoostOfFragment of length " <> show i) $
69
+ whnf (weightBoostOfFragment weightSnapshot) fragment
70
70
71
71
-- | An infinite list of chain fragments
72
72
fragments :: [AF. AnchoredFragment TestBlock ]
0 commit comments