Cost model for assetCount (CIP-0168) - #7918
Open
Unisay wants to merge 1 commit into
Open
Conversation
Contributor
|
Contributor
Author
Unisay
force-pushed
the
yura/issue-2312-assetcount-costing
branch
from
August 21, 2026 12:47
d1ce52d to
9642f93
Compare
Benchmarks the builtin over 101 values and adds the two resulting parameters to the cost model record, the JSON variants and the ledger API parameter lists. The model is a constant. Measured across sizes 0 to 31153 the time stays within 2%, which is what reading a maintained field predicts. This discharges the condition CIP-0168 places on the builtin: the derived alternative starts with `valueData` at 38159ps per asset, before the `unsafeDataAsMap` and list walk it also needs, so there is no size at which it is cheaper. Also groups the `TestCostModels` entries by feature area rather than by batch, which is what the rest of that list does: `multiIndexArray` moves into the existing Arrays group and the two batch-7 trailers go away. Closes IntersectMBO/plutus-private#2312.
Unisay
force-pushed
the
yura/issue-2312-assetcount-costing
branch
from
August 21, 2026 13:24
9642f93 to
d275fea
Compare
Unisay
marked this pull request as ready for review
August 21, 2026 15:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Benchmarks the builtin over 101 values and adds the two resulting parameters to the cost model record, the five JSON variants and the ledger API parameter lists. The builtin itself landed in #7912; this gives it a cost model in place of
unimplementedCostingFun.The model is a constant: across sizes 0 to 31153 the measured time stays within 2%.
This discharges the condition CIP-0168 places on the builtin. The derived alternative starts with
valueDataat 38159ps per asset, before theunsafeDataAsMapand list walk it also needs, so there is no size at which it is cheaper.Closes IntersectMBO/plutus-private#2312.