A real validator spends a meaningful share of its execution budget on Value plumbing: unioning values and looking up individual amounts inside the nested Map CurrencySymbol (Map TokenName Integer). CAPE measures whole contracts, so that cost is always tangled up with everything else a scenario does. There is no place to see what a single Value idiom costs on its own, or to compare two ways of writing it.
Proposal: add a small family of focused scenarios, each exercising one common Value operation on representative inputs and measured like any other submission. A candidate starting set:
unionValue
unionValueWithoutCurrencyName
- lookup of a single
(CurrencySymbol, TokenName) amount
- summing the lovelace across a list of outputs
The exact list and the input shapes (how many currency symbols, how many token names per symbol, how many outputs) still need to be pinned down before this is actionable.
Why it is worth having:
- A cost baseline for the operations that dominate real contracts, independent of any one contract's logic.
- A shared target where the Plinth / Plutarch / Aiken / Scalus implementations of the same primitive can be compared directly, which is harder to do fairly inside a full contract.
The valuePaidTo replacement in the escrow submission (folding raw lovelace entries instead of mconcat-ing whole Values) is exactly the kind of choice these micro-benchmarks would let us measure in isolation.
A real validator spends a meaningful share of its execution budget on
Valueplumbing: unioning values and looking up individual amounts inside the nestedMap CurrencySymbol (Map TokenName Integer). CAPE measures whole contracts, so that cost is always tangled up with everything else a scenario does. There is no place to see what a singleValueidiom costs on its own, or to compare two ways of writing it.Proposal: add a small family of focused scenarios, each exercising one common
Valueoperation on representative inputs and measured like any other submission. A candidate starting set:unionValueunionValueWithoutCurrencyName(CurrencySymbol, TokenName)amountThe exact list and the input shapes (how many currency symbols, how many token names per symbol, how many outputs) still need to be pinned down before this is actionable.
Why it is worth having:
The
valuePaidToreplacement in the escrow submission (folding raw lovelace entries instead ofmconcat-ing wholeValues) is exactly the kind of choice these micro-benchmarks would let us measure in isolation.