Skip to content

Commit

Permalink
Renamed to ASTSize, changed to Maybe CoverageIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
bezirg committed Jun 8, 2024
1 parent c9b77f5 commit f0b54a5
Show file tree
Hide file tree
Showing 35 changed files with 785 additions and 784 deletions.
4 changes: 2 additions & 2 deletions plutus-benchmark/marlowe/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ main = do
allTests =
testGroup "plutus-benchmark Marlowe tests"
[ runTestGhc ["semantics"] $
goldenSize "semantics" marloweValidator
goldenASTSize "semantics" marloweValidator
: [ goldenUEvalBudget name [value]
| bench <- semanticsMBench
, let (name, value) = mkBudgetTest marloweValidator bench
]
, runTestGhc ["role-payout"] $
goldenSize "role-payout" rolePayoutValidator
goldenASTSize "role-payout" rolePayoutValidator
: [ goldenUEvalBudget name [value]
| bench <- rolePayoutMBench
, let (name, value) = mkBudgetTest rolePayoutValidator bench
Expand Down
16 changes: 9 additions & 7 deletions plutus-benchmark/nofib/src/PlutusBenchmark/NoFib/Knights/Sort.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
{-# LANGUAGE NoImplicitPrelude #-}

module PlutusBenchmark.NoFib.Knights.Sort
( insertSort,
mergeSort,
quickSort
) where

import PlutusTx.Prelude qualified as Tx
import PlutusTx.Builtins as Tx
import PlutusTx.Prelude as Tx

{-# INLINABLE insertSort #-}
insertSort :: (Tx.Ord a) => [a] -> [a]
Expand All @@ -25,8 +27,8 @@ mergeSort xs
= if (n <=1 ) then xs
else
(mergeList
( mergeSort (take (n `div` 2) xs))
( mergeSort (drop (n `div` 2) xs)))
( mergeSort (take (n `divideInteger` 2) xs))
( mergeSort (drop (n `divideInteger` 2) xs)))
where
n = length xs

Expand Down Expand Up @@ -99,9 +101,9 @@ randomIntegers s1 s2 =
if 1 <= s2 && s2 <= 2147483398 then
rands s1 s2
else
error "randomIntegers: Bad second seed."
error () -- "randomIntegers: Bad second seed."
else
error "randomIntegers: Bad first seed."
error () -- "randomIntegers: Bad first seed."

{-# INLINABLE rands #-}
rands :: Integer -> Integer -> [Integer]
Expand All @@ -110,11 +112,11 @@ rands s1 s2
else
z : rands s1'' s2''
where
k = s1 `div` 53668
k = s1 `divideInteger` 53668
s1' = 40014 * (s1 - k * 53668) - k * 12211
s1'' = if s1' < 0 then s1' + 2147483563 else s1'

k' = s2 `div` 52774
k' = s2 `divideInteger` 52774
s2' = 40692 * (s2 - k' * 52774) - k' * 3791
s2'' = if s2' < 0 then s2' + 2147483399 else s2'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1474894000
| mem: 7526812})
| mem: 7526812})
Loading

0 comments on commit f0b54a5

Please sign in to comment.