Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plutus-benchmark/bitwise/test/9.6/Ed25519.golden.eval
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CPU: 1_628_853_655_874
CPU: 1_628_939_350_255
Memory: 4_738_061_278
AST Size: 3_319
Flat Size: 5_260
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ VRF example

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 659 (4.0%) 1218013138 (12.2%) 31647 (0.2%)
- 659 (4.0%) 1217919549 (12.2%) 31647 (0.2%)

G1 Verify

Expand All @@ -127,19 +127,19 @@ Aggregate Multi Key

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 1786 (10.9%) 3423350991 (34.2%) 280881 (2.0%)
- 1786 (10.9%) 3423257402 (34.2%) 280881 (2.0%)

Schnorr Signature G1

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 341 (2.1%) 319518466 (3.2%) 10594 (0.1%)
- 341 (2.1%) 319331288 (3.2%) 10594 (0.1%)

Schnorr Signature G2

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 485 (3.0%) 551729073 (5.5%) 10762 (0.1%)
- 485 (3.0%) 551541895 (5.5%) 10762 (0.1%)

Groth16Verify succeeded
Simple Verify succeeded
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1174391
({cpu: 1166072
| mem: 602})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1130015
({cpu: 1163578
| mem: 601})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1130015
({cpu: 1163578
| mem: 601})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2404639
({cpu: 2429883
| mem: 1404})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2449573
({cpu: 2432935
| mem: 1405})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1174391
({cpu: 1166072
| mem: 602})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1130015
({cpu: 1163578
| mem: 601})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1130015
({cpu: 1163578
| mem: 601})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2404639
({cpu: 2429883
| mem: 1404})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 802})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 96871400
({cpu: 2028201
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 802})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 96871400
({cpu: 2028201
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 802})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 96871400
({cpu: 2028201
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 802})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 96871400
({cpu: 2028201
| mem: 1824})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 1434707
({cpu: 1476804
| mem: 801})
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Changed

- Improved implementations with significantly lower costs for the `byteStringToInteger` and `integerToByteString` Plutus Core builtins.

12 changes: 10 additions & 2 deletions plutus-core/cost-model/budgeting-bench/Benchmarks/Bitwise.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ memoryUsageAsNumBytes = (8 *) . fromSatInt . sumCostStream . flattenCostRose . m
conversion perhaps taking a fraction longer. We just generate a costing
function for big-endian conversion and use that for the little-endian
conversion as well. A quadratic function fitted to inputs of size up to 150
gives a good fit and extrapolates well to larger inputs. -}
gives a good fit and extrapolates well to larger inputs. UPDATE: PR #7439
introduced a linear-time implementation of `byteStringToInteger`: this is
still covered by a quadratic function, but we have to do some extra work in
`models.R` to make sure that a very small leading term isn't rounded up to a
non-zero costing integer. -}
benchByteStringToInteger :: Benchmark
benchByteStringToInteger =
createTwoTermBuiltinBenchElementwise ByteStringToInteger [] $ fmap (\x -> (True, x)) (makeSample seedA)
Expand All @@ -72,7 +76,11 @@ benchByteStringToInteger =
time required for this is negligible in comparison to the conversion time.
It's important to make sure that the memory cost does take account of the width
though. The sample we use gives us bytestrings up to 8*150 = 1200 bytes long.
This is well within the 8192-byte limit. -}
This is well within the 8192-byte limit. UPDATE: PR #7439 introduced a
linear-time implementation of `integerToByteString`: this is still covered by a
quadratic function, but we have to do some extra work in `models.R` to make
sure that a very small leading term isn't rounded up to a non-zero costing
integer. -}
benchIntegerToByteString :: Benchmark
benchIntegerToByteString =
let b = IntegerToByteString
Expand Down
Loading