IntersectMBO / IntersectMBO/UPLC-CAPE

Add synthetic benchmark scenarios for common Value operations

Open
#227 0 comments 0 reactions 1 assignee Claimed by @Unisay View on GitHub
UPLC-CAPE
Dominant language
Untyped Plutus Core
Stars
13
Forks
10
Avg merge
9h 54m
Merged PRs (30d)
2

Description

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 `Value`s) is exactly the kind of choice these micro-benchmarks would let us measure in isolation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.