Merge pull request #23 from Liqwid-Labs/emiflake/bench

Benchmark setup
This commit is contained in:
Jack Hodgkinson 2022-02-16 16:10:43 +00:00 committed by GitHub
commit f958c4794e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 121 additions and 6 deletions

View file

@ -130,3 +130,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,1280339,4400,284
1 name cpu mem size
2 full_scripts:authorityTokenPolicy 1280339 4400 284

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

@ -1,3 +1,4 @@
packages: ./.
benchmarks: true
tests: true

80
flake.lock generated
View file

@ -49,6 +49,23 @@
"type": "github"
}
},
"autodocodec": {
"flake": false,
"locked": {
"lastModified": 1644358110,
"narHash": "sha256-X1TNZlmO2qDFk3OL4Z1v/gzvd3ouoACAiMweutsYek4=",
"owner": "srid",
"repo": "autodocodec",
"rev": "42b42a7407f33c6c74fa4e8c84906aebfed28daf",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "ghc921",
"repo": "autodocodec",
"type": "github"
}
},
"cabal-32": {
"flake": false,
"locked": {
@ -788,6 +805,7 @@
"inputs": {
"Shrinker": "Shrinker",
"Win32-network": "Win32-network",
"autodocodec": "autodocodec",
"cardano-base": "cardano-base",
"cardano-crypto": "cardano-crypto",
"cardano-prelude": "cardano-prelude",
@ -807,15 +825,18 @@
],
"plutus": "plutus",
"protolude": "protolude",
"safe-coloured-text": "safe-coloured-text",
"sized-functors": "sized-functors",
"th-extras": "th-extras"
"sydtest": "sydtest",
"th-extras": "th-extras",
"validity": "validity"
},
"locked": {
"lastModified": 1644875667,
"narHash": "sha256-eNKEubOfkVGmDX1HbbCTbtIjEyXfxlYedrWuwhOLVrQ=",
"lastModified": 1645006916,
"narHash": "sha256-j8o0D48LfDYqf07bi34474lkFnMZ5TNvcZmACVMw3yA=",
"owner": "Plutonomicon",
"repo": "plutarch",
"rev": "a0cbe99921aad7c5df9239cb0240933e4d9b2eaa",
"rev": "c77fcd605269bd8183d5496e297eb38503ea0e29",
"type": "github"
},
"original": {
@ -915,6 +936,23 @@
"plutarch": "plutarch"
}
},
"safe-coloured-text": {
"flake": false,
"locked": {
"lastModified": 1644357337,
"narHash": "sha256-sXSKw8m6O9K/H2BBiYqO5e4sJIo+9UP+UvEukRn28d8=",
"owner": "srid",
"repo": "safe-coloured-text",
"rev": "034f3612525568b422e0c62b52417d77b7cf31c2",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "ghc921",
"repo": "safe-coloured-text",
"type": "github"
}
},
"sized-functors": {
"flake": false,
"locked": {
@ -980,6 +1018,23 @@
"type": "github"
}
},
"sydtest": {
"flake": false,
"locked": {
"lastModified": 1644358460,
"narHash": "sha256-1ZxTLL5YVxktyHqfMywwsNGx5nxNMPXnq33QI6BcvUI=",
"owner": "srid",
"repo": "sydtest",
"rev": "5b572105c30f79c5e20637c6af4eedf39e0ac85a",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "ghc921",
"repo": "sydtest",
"type": "github"
}
},
"th-extras": {
"flake": false,
"locked": {
@ -996,6 +1051,23 @@
"rev": "787ed752c1e5d41b5903b74e171ed087de38bffa",
"type": "github"
}
},
"validity": {
"flake": false,
"locked": {
"lastModified": 1644358698,
"narHash": "sha256-dpMIu08qXMzy8Kilk/2VWpuwIsfqFtpg/3mkwt5pdjA=",
"owner": "srid",
"repo": "validity",
"rev": "f7982549b95d0ab727950dc876ca06b1862135ba",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "ghc921",
"repo": "validity",
"type": "github"
}
}
},
"root": "root",

View file

@ -42,7 +42,7 @@
inherit (plutarch) cabalProjectLocal;
extraSources = plutarch.extraSources ++ [{
src = inputs.plutarch;
subdirs = [ "." ];
subdirs = [ "." "plutarch-benchmark" ];
}];
modules = [ (plutarch.haskellModule system) ];
shell = {
@ -64,7 +64,11 @@
inherit (plutarch) tools;
additional = ps: [ ps.plutarch ps.tasty-quickcheck ];
additional = ps: [
ps.plutarch
ps.plutarch-benchmark
ps.tasty-quickcheck
];
};
};

View file

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