Skip to content

Add synthetic benchmark scenarios for common Value operations #227

Description

@Unisay

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.

Metadata

Metadata

Assignees

Labels

UPLC-CAPETracks UPLC-CAPE scope

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions