add benchmarking stub using plutus-benchmark

This commit is contained in:
Emily Martins 2022-02-09 18:39:13 +01:00
parent 0e916dfdfc
commit c1d267b401
5 changed files with 47 additions and 2 deletions

View file

@ -101,3 +101,12 @@ test-suite agora-test
type: exitcode-stdio-1.0
main-is: Spec.hs
hs-source-dirs: test
benchmark agora-bench
import: lang, deps
hs-source-dirs: bench
main-is: Main.hs
type: exitcode-stdio-1.0
build-depends:
, plutarch-benchmark
, agora

2
bench.csv Normal file
View file

@ -0,0 +1,2 @@
name,cpu,mem,size
full scripts:authorityTokenPolicy,1399431,4800,363
1 name cpu mem size
2 full scripts:authorityTokenPolicy 1399431 4800 363

25
bench/Main.hs Normal file
View file

@ -0,0 +1,25 @@
module Main (main) where
import Prelude
--------------------------------------------------------------------------------
import Plutarch.Benchmark
import Plutus.V1.Ledger.Value qualified as Value
--------------------------------------------------------------------------------
import Agora.AuthorityToken qualified as Agora
--------------------------------------------------------------------------------
main :: IO ()
main = do
benchMain benchmarks
benchmarks :: [NamedBenchmark]
benchmarks =
benchGroup
"full_scripts"
[ bench "authorityTokenPolicy" $ Agora.authorityTokenPolicy (Agora.AuthorityToken (Value.assetClass "" ""))
]

View file

@ -192,7 +192,7 @@
}
{
src = inputs.plutarch;
subdirs = [ "." ];
subdirs = [ "." "plutarch-benchmark" ];
}
{
src = inputs.cardano-addresses;
@ -321,7 +321,12 @@
graphviz
];
additional = ps: [ ps.plutarch ps.plutus-ledger ps.plutus-extra ];
additional = ps: [
ps.plutarch
ps.plutarch-benchmark
ps.plutus-ledger
ps.plutus-extra
];
tools.haskell-language-server = { };
};

View file

@ -2,3 +2,7 @@ cradle:
cabal:
- path: "./src"
component: "lib:agora"
- path: "./bench"
component: "benchmark:agora-bench"
- path: "./test"
component: "test:agora-test"