Skip to content

Commit

Permalink
Add benchmark for 'likelihood'.
Browse files Browse the repository at this point in the history
This is the main component of the reward calculation.
  • Loading branch information
nc6 committed Sep 15, 2020
1 parent 8dada75 commit e0c392c
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -22,6 +22,7 @@ import BenchValidation
-- How to compute an initial state with N StakePools

import Cardano.Ledger.Era (Crypto (..))
import Cardano.Slotting.Slot (EpochSize (..))
import Control.DeepSeq (NFData)
import Control.Iterate.SetAlgebra (dom, forwards, keysEqual, (▷), (◁))
import Control.Iterate.SetAlgebraInternal (compile, compute, run)
Expand Down Expand Up @@ -57,6 +58,7 @@ import Shelley.Spec.Ledger.LedgerState
UTxOState (..),
stakeDistr,
)
import Shelley.Spec.Ledger.Rewards (likelihood)
import Shelley.Spec.Ledger.UTxO (UTxO)
import System.IO.Unsafe (unsafePerformIO)
import Test.QuickCheck.Gen as QC
Expand Down Expand Up @@ -483,6 +485,7 @@ main =
(generate $ genChainInEpoch 5)
( \cs ->
bench "createRUpd" $ whnf (createRUpd testGlobals) cs
)
),
bench "likelihood" $ whnf (likelihood 1234 0.1) (EpochSize 10000)
]
]

0 comments on commit e0c392c

Please sign in to comment.