Skip to content

Commit 6fac0b4

Browse files
authored
Merge pull request #6032 from IntersectMBO/fmaste/bench-master
bench: add PlutusV3 RIPEMD-160 benchmarks; workbench maintenance
2 parents 01bda2e + b25294e commit 6fac0b4

File tree

57 files changed

+475480
-1039
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+475480
-1039
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ Changelogs for components can be found as follows:
1010
- [cardano-tracer](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-tracer/CHANGELOG.md)
1111
- [cardano-node-capi](https://github.com/IntersectMBO/cardano-node/blob/master/cardano-node-capi/CHANGELOG.md)
1212
- [bench/tx-generator](https://github.com/IntersectMBO/cardano-node/blob/master/bench/tx-generator/CHANGELOG.md)
13-
- [bench/trace-analyzer](https://github.com/IntersectMBO/cardano-node/blob/master/bench/trace-analyzer/CHANGELOG.md)
1413

bench/cardano-profile/app/cardano-profile.hs

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
--------------------------------------------------------------------------------
44

55
import Prelude
6+
7+
import Data.Function ((&))
68
import System.Environment (lookupEnv)
79
-- Package: aeson.
810
import qualified Data.Aeson as Aeson
11+
-- Package: aeson-pretty
12+
import Data.Aeson.Encode.Pretty as Aeson
913
-- Package: bytestring.
1014
import qualified Data.ByteString.Lazy.Char8 as BSL8
1115
-- Package: optparse-applicative-fork.
1216
import qualified Options.Applicative as OA
1317
-- Package: self.
1418
import qualified Cardano.Benchmarking.Profile as Profiles
19+
import qualified Cardano.Benchmarking.Profile.NodeSpecs as NodeSpecs
1520
import qualified Cardano.Benchmarking.Profile.Types as Types
1621

1722
--------------------------------------------------------------------------------
@@ -20,11 +25,16 @@ data Cli =
2025
Names
2126
| NamesCloudNoEra
2227
| All
23-
| ByName String
28+
| ByName PrettyPrint String
2429
| LibMK
30+
| NodeSpecs FilePath FilePath
2531
| ToJson String
2632
| FromJson String
2733

34+
data PrettyPrint =
35+
PrettyPrint
36+
| SingleLine
37+
2838
--------------------------------------------------------------------------------
2939

3040
main :: IO ()
@@ -40,15 +50,31 @@ main = do
4050
obj <- lookupOverlay
4151
BSL8.putStrLn $ Aeson.encode $ Profiles.profiles obj
4252
-- Print a single profiles, with an optional overlay.
43-
(ByName profileName) -> do
53+
(ByName prettyPrint profileName) -> do
4454
obj <- lookupOverlay
4555
case Profiles.byName profileName obj of
4656
Nothing -> error $ "No profile named \"" ++ profileName ++ "\""
4757
(Just profile) ->
48-
let aeson = Aeson.encode profile
58+
let
59+
prettyConf = defConfig { confCompare = compare, confTrailingNewline = True }
60+
aeson = profile & case prettyPrint of
61+
PrettyPrint -> Aeson.encodePretty' prettyConf
62+
SingleLine -> Aeson.encode
4963
in BSL8.putStrLn aeson
5064
LibMK -> do
5165
mapM_ putStrLn Profiles.libMk
66+
(NodeSpecs profilePath topologyPath) -> do
67+
eitherProfile <- Aeson.eitherDecodeFileStrict profilePath
68+
let profile = case eitherProfile of
69+
(Left errorMsg) ->
70+
error $ "Not a valid profile: " ++ errorMsg
71+
(Right value) -> value
72+
eitherTopology <- Aeson.eitherDecodeFileStrict topologyPath
73+
let topology = case eitherTopology of
74+
(Left errorMsg) ->
75+
error $ "Not a valid topology: " ++ errorMsg
76+
(Right value) -> value
77+
BSL8.putStrLn $ Aeson.encode $ NodeSpecs.nodeSpecs profile topology
5278
-- Print a single profiles, with an optional overlay.
5379
(ToJson filePath) -> print filePath
5480
-- str <- readFile filePath
@@ -100,15 +126,30 @@ cliParser = OA.hsubparser $
100126
<>
101127
OA.command "by-name"
102128
(OA.info
103-
(ByName <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
129+
(ByName SingleLine <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
104130
(OA.fullDesc <> OA.header "by-name" <> OA.progDesc "Create profile")
105131
)
132+
<>
133+
OA.command "by-name-pretty"
134+
(OA.info
135+
(ByName PrettyPrint <$> OA.argument OA.str (OA.metavar "PROFILE-NAME"))
136+
(OA.fullDesc <> OA.header "by-name-pretty" <> OA.progDesc "Create profile (pretty-printed)")
137+
)
106138
<>
107139
OA.command "lib-make"
108140
(OA.info
109141
(pure LibMK)
110142
(OA.fullDesc <> OA.header "lib-make" <> OA.progDesc "Makefile include")
111143
)
144+
<>
145+
OA.command "node-specs"
146+
(OA.info
147+
( NodeSpecs
148+
<$> OA.argument OA.str (OA.metavar "PROFILE-JSON-FILEPATH" )
149+
<*> OA.argument OA.str (OA.metavar "TOPOLOGY-JSON-FILEPATH")
150+
)
151+
(OA.fullDesc <> OA.header "node-specs" <> OA.progDesc "Create the profile's node-specs.json file")
152+
)
112153
<>
113154
OA.command "to-json"
114155
(OA.info

bench/cardano-profile/cardano-profile.cabal

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 3.0
22

33
name: cardano-profile
4-
version: 8.6.0
4+
version: 8.7.0
55
synopsis: A Cardano benchmarking profile generator
66
description: A Cardano benchmarking profile generator.
77
category: Cardano,
@@ -17,6 +17,12 @@ data-files: data/all-profiles.json
1717
data/ci-test-bage.json
1818
data/genesis/epoch-timeline.json
1919
data/genesis/overlays/*.json
20+
data/test/default-coay/*.json
21+
data/test/chainsync-early-alonzo-coay/*.json
22+
data/test/chainsync-early-byron-coay/*.json
23+
data/test/ci-test-coay/*.json
24+
data/test/ci-test-dense10-coay/*.json
25+
data/test/fast-nomadperf-coay/*.json
2026

2127
common project-config
2228
build-depends: base >= 4.14 && < 5
@@ -37,6 +43,7 @@ library
3743
other-modules: Paths_cardano_profile
3844
autogen-modules: Paths_cardano_profile
3945
exposed-modules: Cardano.Benchmarking.Profile
46+
-- Profile definitions.
4047
, Cardano.Benchmarking.Profile.Builtin.Cloud
4148
, Cardano.Benchmarking.Profile.Builtin.Empty
4249
, Cardano.Benchmarking.Profile.Builtin.ForgeStress
@@ -52,6 +59,7 @@ library
5259
, Cardano.Benchmarking.Profile.Builtin.Scenario.Idle
5360
, Cardano.Benchmarking.Profile.Builtin.Scenario.TracerOnly
5461
, Cardano.Benchmarking.Profile.Extra.Scaling
62+
, Cardano.Benchmarking.Profile.NodeSpecs
5563
, Cardano.Benchmarking.Profile.Primitives
5664
, Cardano.Benchmarking.Profile.Vocabulary
5765
, Cardano.Benchmarking.Profile.Types
@@ -70,6 +78,7 @@ executable cardano-profile
7078
hs-source-dirs: app/
7179
main-is: cardano-profile.hs
7280
build-depends: aeson
81+
, aeson-pretty
7382
, vector
7483
, bytestring
7584
, optparse-applicative-fork
@@ -81,7 +90,8 @@ test-suite cardano-profile-test
8190
hs-source-dirs: test/
8291
main-is: Main.hs
8392
type: exitcode-stdio-1.0
84-
other-modules: Paths_cardano_profile
93+
other-modules: Cardano.Benchmarking.Profile.NodeSpecs.Tests
94+
, Paths_cardano_profile
8595
autogen-modules: Paths_cardano_profile
8696
build-depends: base
8797
, aeson

bench/cardano-profile/data/all-profiles.json

Lines changed: 469376 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)