add benchmarking stub using plutus-benchmark
This commit is contained in:
parent
0e916dfdfc
commit
c1d267b401
5 changed files with 47 additions and 2 deletions
|
|
@ -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
2
bench.csv
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
name,cpu,mem,size
|
||||
full scripts:authorityTokenPolicy,1399431,4800,363
|
||||
|
25
bench/Main.hs
Normal file
25
bench/Main.hs
Normal 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 "" ""))
|
||||
]
|
||||
|
|
@ -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 = { };
|
||||
};
|
||||
|
|
|
|||
4
hie.yaml
4
hie.yaml
|
|
@ -2,3 +2,7 @@ cradle:
|
|||
cabal:
|
||||
- path: "./src"
|
||||
component: "lib:agora"
|
||||
- path: "./bench"
|
||||
component: "benchmark:agora-bench"
|
||||
- path: "./test"
|
||||
component: "test:agora-test"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue