Skip to content

Commit 5b60cfc

Browse files
committed
feat(cost-model): apply statistical models from updated Value benchmarks
Update cost parameters for Value builtin functions based on newly generated statistical models from benchmark data: - lookupCoin: Reduced base cost from 284421 to 272043 CPU units - valueContains: Dramatically reduced from 42125119 to 6684283 CPU units - valueData: Slight increase from 164963 to 167190 CPU units - unValueData: Reduced base cost from 10532326261 to 1000 CPU units These updates replace placeholder costs with parameter-driven models derived from benchmarking, making Value operations significantly more efficient on-chain while maintaining conservative safety margins.
1 parent 824134a commit 5b60cfc

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

plutus-core/cost-model/data/builtinCostModelA.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,8 +1209,8 @@
12091209
"lookupCoin": {
12101210
"cpu": {
12111211
"arguments": {
1212-
"intercept": 284421,
1213-
"slope": 1
1212+
"intercept": 272043,
1213+
"slope": 16
12141214
},
12151215
"type": "linear_in_z"
12161216
},
@@ -1222,8 +1222,8 @@
12221222
"valueContains": {
12231223
"cpu": {
12241224
"arguments": {
1225-
"intercept": 42125119,
1226-
"slope": 30
1225+
"intercept": 6684283,
1226+
"slope": 1000
12271227
},
12281228
"type": "added_sizes"
12291229
},
@@ -1234,7 +1234,7 @@
12341234
},
12351235
"valueData": {
12361236
"cpu": {
1237-
"arguments": 164963,
1237+
"arguments": 167190,
12381238
"type": "constant_cost"
12391239
},
12401240
"memory": {
@@ -1245,8 +1245,8 @@
12451245
"unValueData": {
12461246
"cpu": {
12471247
"arguments": {
1248-
"intercept": 10532326261,
1249-
"slope": 431
1248+
"intercept": 1000,
1249+
"slope": 19835
12501250
},
12511251
"type": "linear_in_x"
12521252
},

plutus-core/cost-model/data/builtinCostModelB.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,8 +1209,8 @@
12091209
"lookupCoin": {
12101210
"cpu": {
12111211
"arguments": {
1212-
"intercept": 284421,
1213-
"slope": 1
1212+
"intercept": 272043,
1213+
"slope": 16
12141214
},
12151215
"type": "linear_in_z"
12161216
},
@@ -1222,8 +1222,8 @@
12221222
"valueContains": {
12231223
"cpu": {
12241224
"arguments": {
1225-
"intercept": 42125119,
1226-
"slope": 30
1225+
"intercept": 6684283,
1226+
"slope": 1000
12271227
},
12281228
"type": "added_sizes"
12291229
},
@@ -1234,7 +1234,7 @@
12341234
},
12351235
"valueData": {
12361236
"cpu": {
1237-
"arguments": 164963,
1237+
"arguments": 167190,
12381238
"type": "constant_cost"
12391239
},
12401240
"memory": {
@@ -1245,8 +1245,8 @@
12451245
"unValueData": {
12461246
"cpu": {
12471247
"arguments": {
1248-
"intercept": 10532326261,
1249-
"slope": 431
1248+
"intercept": 1000,
1249+
"slope": 19835
12501250
},
12511251
"type": "linear_in_x"
12521252
},

plutus-core/cost-model/data/builtinCostModelC.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,8 @@
12271227
"lookupCoin": {
12281228
"cpu": {
12291229
"arguments": {
1230-
"intercept": 284421,
1231-
"slope": 1
1230+
"intercept": 272043,
1231+
"slope": 16
12321232
},
12331233
"type": "linear_in_z"
12341234
},
@@ -1240,8 +1240,8 @@
12401240
"valueContains": {
12411241
"cpu": {
12421242
"arguments": {
1243-
"intercept": 42125119,
1244-
"slope": 30
1243+
"intercept": 6684283,
1244+
"slope": 1000
12451245
},
12461246
"type": "added_sizes"
12471247
},
@@ -1252,7 +1252,7 @@
12521252
},
12531253
"valueData": {
12541254
"cpu": {
1255-
"arguments": 164963,
1255+
"arguments": 167190,
12561256
"type": "constant_cost"
12571257
},
12581258
"memory": {
@@ -1263,8 +1263,8 @@
12631263
"unValueData": {
12641264
"cpu": {
12651265
"arguments": {
1266-
"intercept": 10532326261,
1267-
"slope": 431
1266+
"intercept": 1000,
1267+
"slope": 19835
12681268
},
12691269
"type": "linear_in_x"
12701270
},

0 commit comments

Comments
 (0)