Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the arbitrary evaluation nonsense in 'nofib'
- Loading branch information
1 parent
1843823
commit 532722e
Showing
5 changed files
with
63 additions
and
44 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
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,8 +1,20 @@ | ||
{-# LANGUAGE BangPatterns #-} | ||
|
||
{- | Plutus benchmarks for the CEK machine based on some nofib examples. -} | ||
module Main where | ||
|
||
import PlutusBenchmark.Common (benchTermCek) | ||
import Shared (benchWith) | ||
import Shared (benchWith, evaluateCekLikeInProd, mkEvalCtx) | ||
|
||
import Control.DeepSeq (force) | ||
import Control.Exception (evaluate) | ||
import Criterion (whnf) | ||
|
||
main :: IO () | ||
main = benchWith benchTermCek | ||
main = do | ||
evalCtx <- evaluate $ force mkEvalCtx | ||
let mkCekBM term = | ||
-- `force` to try to ensure that deserialiation is not included in benchmarking time. | ||
let !benchTerm = force term | ||
eval = either (error . show) (\_ -> ()) . evaluateCekLikeInProd evalCtx | ||
in whnf eval benchTerm | ||
benchWith mkCekBM |
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