Skip to content

Conversation

@kwxm
Copy link
Contributor

@kwxm kwxm commented Dec 16, 2025

This updates the cost model to reflect the improved performance of integerToByteString and byteStringToInteger due to #7439: the execution times of both functions are now linear in the sizes of their inputs instead of quadratic: see the builtinCostModel JSON files.

For small inputs values (less than size 2 or 3, so about 20 bytes) the new costs are slightly higher than the old ones (possibly due to randomness in the benchmarking process), but for larger inputs the new versions are dramatically faster: see the attached PNGs (blue points are benchmark times for the old versions, green ones are for the new versions).

The costing functions in this PR are provisional and may be updated before the new cost model is deployed on the chain.

byteStringToInteger integerToByteString

@github-actions
Copy link
Contributor

Execution Budget Golden Diff

ffc6471 (master) vs 855bb45

output

plutus-benchmark/bitwise/test/9.6/Ed25519.golden.eval

Metric Old New Δ%
CPU 1_628_853_655_874 1_628_939_350_255 +0.01%

This comment will get updated when changes are made.

@kwxm kwxm requested a review from zliu41 December 16, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants