Skip to content

Commit

Permalink
SCP 3619: costing for serialiseData (#4480)
Browse files Browse the repository at this point in the history
* Cost function for serialiseData, improved modelling method for fan-shaped data

* Minor corrections

* Tidying up

* Make info messages clearer

* Tidying up

* Tidying up

* Expand comment

* Typo
  • Loading branch information
Kenneth MacKenzie authored Mar 22, 2022
1 parent dc92754 commit bd97960
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 120 deletions.
5 changes: 4 additions & 1 deletion plutus-core/cost-model/budgeting-bench/Benchmarks/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ benchEqualsData =
benchSerialiseData :: Benchmark
benchSerialiseData =
createOneTermBuiltinBench SerialiseData [] args
where args = dataSampleForEq -- FIXME: is this a good sample for serialization?
where args = dataSampleForEq
-- FIXME: see if we can find a better sample for this. More generally, how
-- does the internal structure of a Data object influence serialisation
-- time? What causes a Data object to be quick or slow to serialise?

makeBenchmarks :: StdGen -> [Benchmark]
makeBenchmarks gen =
Expand Down
8 changes: 4 additions & 4 deletions plutus-core/cost-model/data/builtinCostModel.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@
"equalsData": {
"cpu": {
"arguments": {
"intercept": 1083531,
"slope": 12717
"intercept": 1171539,
"slope": 18595
},
"type": "min_size"
},
Expand Down Expand Up @@ -505,8 +505,8 @@
"serialiseData": {
"cpu": {
"arguments": {
"intercept": 1000,
"slope": 255499
"intercept": 1194288,
"slope": 389135
},
"type": "linear_cost"
},
Expand Down
Loading

0 comments on commit bd97960

Please sign in to comment.