Skip to content

Commit

Permalink
Inline fixed point combinators by default (#6841)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliu41 authored Feb 13, 2025
1 parent 2e69d91 commit d05da89
Show file tree
Hide file tree
Showing 313 changed files with 1,787 additions and 1,751 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For each boolean option, you can add a `no-` prefix to switch it off, such as `n

|Option|Value Type|Default|Description|
|-|-|-|-|
|`conservative-optimisation`|Bool|False|When conservative optimisation is used, only the optimisations that never make the program worse (in terms of cost or size) are employed. Implies `no-relaxed-float-in`, `no-inline-constants`, `no-simplifier-evaluate-builtins`, and `preserve-logging`.|
|`conservative-optimisation`|Bool|False|When conservative optimisation is used, only the optimisations that never make the program worse (in terms of cost or size) are employed. Implies `no-relaxed-float-in`, `no-inline-constants`, `no-inline-fix`, `no-simplifier-evaluate-builtins`, and `preserve-logging`.|
|`context-level`|Int|1|Set context level for error messages.|
|`coverage-all`|Bool|False|Add all available coverage annotations in the trace output|
|`coverage-boolean`|Bool|False|Add boolean coverage annotations in the trace output|
Expand All @@ -31,6 +31,7 @@ For each boolean option, you can add a `no-` prefix to switch it off, such as `n
|`dump-tplc`|Bool|False|Dump Typed Plutus Core|
|`dump-uplc`|Bool|False|Dump Untyped Plutus Core|
|`inline-constants`|Bool|True|Always inline constants. Inlining constants always reduces script costs slightly, but may increase script sizes if a large constant is used more than once. Implied by `no-conservative-optimisation`.|
|`inline-fix`|Bool|True|Always inline fixed point combinators. This is generally preferable as it often enables further optimization, though it may increase script size.|
|`max-cse-iterations`|Int|4|Set the max iterations for CSE|
|`max-simplifier-iterations-pir`|Int|12|Set the max iterations for the PIR simplifier|
|`max-simplifier-iterations-uplc`|Int|12|Set the max iterations for the UPLC simplifier|
Expand Down
4 changes: 2 additions & 2 deletions plutus-benchmark/bitwise/test/9.6/8 queens.budget.golden
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 409142294016
| mem: 1575213647})
({cpu: 397650662016
| mem: 1503390947})
2 changes: 1 addition & 1 deletion plutus-benchmark/bitwise/test/9.6/8 queens.size.golden
Original file line number Diff line number Diff line change
@@ -1 +1 @@
397
404
4 changes: 2 additions & 2 deletions plutus-benchmark/bitwise/test/9.6/Ed25519.budget.golden
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2137054479882
| mem: 7088444574})
({cpu: 2053676319882
| mem: 6567331074})
2 changes: 1 addition & 1 deletion plutus-benchmark/bitwise/test/9.6/Ed25519.size.golden
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3417
3420
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
----------------------------------------------------------------------
- 714 (4.4%) 1220805236 (12.2%) 48149 (0.3%)
- 709 (4.3%) 1219413236 (12.2%) 39449 (0.3%)

G1 Verify

Expand All @@ -121,13 +121,13 @@ Aggregate Single Key

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 846 (5.2%) 2720886359 (27.2%) 70002 (0.5%)
- 841 (5.1%) 2718822359 (27.2%) 57102 (0.4%)

Aggregate Multi Key

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 1832 (11.2%) 3446371236 (34.5%) 422386 (3.0%)
- 1856 (11.3%) 3433843236 (34.3%) 344086 (2.5%)

Schnorr Signature G1

Expand Down
32 changes: 16 additions & 16 deletions plutus-benchmark/ed25519-costs/test/9.6/ed25519-costs.golden
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
n Script size CPU usage Memory usage
----------------------------------------------------------------------
0 458 (2.8%) 5130441 (0.1%) 25722 (0.2%)
10 2185 (13.3%) 646555741 (6.5%) 514552 (3.7%)
20 3912 (23.9%) 1287981041 (12.9%) 1003382 (7.2%)
30 5639 (34.4%) 1929406341 (19.3%) 1492212 (10.7%)
40 7366 (45.0%) 2570831641 (25.7%) 1981042 (14.2%)
50 9092 (55.5%) 3212256941 (32.1%) 2469872 (17.6%)
60 10819 (66.0%) 3853682241 (38.5%) 2958702 (21.1%)
70 12546 (76.6%) 4495107541 (45.0%) 3447532 (24.6%)
80 14272 (87.1%) 5136532841 (51.4%) 3936362 (28.1%)
90 15999 (97.7%) 5777958141 (57.8%) 4425192 (31.6%)
100 17726 (108.2%) 6419383441 (64.2%) 4914022 (35.1%)
110 19453 (118.7%) 7060808741 (70.6%) 5402852 (38.6%)
120 21179 (129.3%) 7702234041 (77.0%) 5891682 (42.1%)
130 22906 (139.8%) 8343659341 (83.4%) 6380512 (45.6%)
140 24633 (150.3%) 8985084641 (89.9%) 6869342 (49.1%)
150 26360 (160.9%) 9626509941 (96.3%) 7358172 (52.6%)
0 457 (2.8%) 4938441 (0.0%) 24522 (0.2%)
10 2184 (13.3%) 645403741 (6.5%) 507352 (3.6%)
20 3911 (23.9%) 1285869041 (12.9%) 990182 (7.1%)
30 5638 (34.4%) 1926334341 (19.3%) 1473012 (10.5%)
40 7365 (45.0%) 2566799641 (25.7%) 1955842 (14.0%)
50 9091 (55.5%) 3207264941 (32.1%) 2438672 (17.4%)
60 10818 (66.0%) 3847730241 (38.5%) 2921502 (20.9%)
70 12545 (76.6%) 4488195541 (44.9%) 3404332 (24.3%)
80 14271 (87.1%) 5128660841 (51.3%) 3887162 (27.8%)
90 15998 (97.6%) 5769126141 (57.7%) 4369992 (31.2%)
100 17725 (108.2%) 6409591441 (64.1%) 4852822 (34.7%)
110 19452 (118.7%) 7050056741 (70.5%) 5335652 (38.1%)
120 21178 (129.3%) 7690522041 (76.9%) 5818482 (41.6%)
130 22905 (139.8%) 8330987341 (83.3%) 6301312 (45.0%)
140 24632 (150.3%) 8971452641 (89.7%) 6784142 (48.5%)
150 26359 (160.9%) 9611917941 (96.1%) 7266972 (51.9%)

Off-chain version succeeded on 100 inputs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 197510904
| mem: 846852})
({cpu: 186806904
| mem: 779952})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 16499812194
| mem: 70488132})
({cpu: 15530068194
| mem: 64427232})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 59141074
| mem: 255392})
({cpu: 56117074
| mem: 236492})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 4212184144
| mem: 17998532})
({cpu: 3967240144
| mem: 16467632})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 117905780
| mem: 564480})
({cpu: 111521780
| mem: 524580})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 8992550900
| mem: 41599800})
({cpu: 8498006900
| mem: 38508900})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 37925190
| mem: 186640})
({cpu: 35861190
| mem: 173740})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2323012500
| mem: 10794400})
({cpu: 2195668500
| mem: 9998500})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 203554074
| mem: 988490})
({cpu: 191410074
| mem: 912590})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 296248136
| mem: 1507304})
({cpu: 275464136
| mem: 1377404})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 218828188
| mem: 1072854})
({cpu: 204956188
| mem: 986154})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 177375938
| mem: 850422})
({cpu: 166959938
| mem: 785322})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 199201946
| mem: 960932})
({cpu: 187441946
| mem: 887432})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 185596754
| mem: 887072})
({cpu: 175180754
| mem: 821972})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 184435055
| mem: 880470})
({cpu: 174115055
| mem: 815970})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 231014344
| mem: 1131576})
({cpu: 216566344
| mem: 1041276})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 214343877
| mem: 1046444})
({cpu: 201143877
| mem: 963944})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 198142226
| mem: 955410})
({cpu: 186382226
| mem: 881910})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 219510582
| mem: 1070794})
({cpu: 206214582
| mem: 987694})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 220655269
| mem: 1084970})
({cpu: 206687269
| mem: 997670})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 261001580
| mem: 1305298})
({cpu: 243481580
| mem: 1195798})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 181828760
| mem: 871944})
({cpu: 171412760
| mem: 806844})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 195736220
| mem: 946208})
({cpu: 183976220
| mem: 872708})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 174959050
| mem: 822766})
({cpu: 165503050
| mem: 763666})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 219662300
| mem: 1087042})
({cpu: 205598300
| mem: 999142})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 192428232
| mem: 928182})
({cpu: 180860232
| mem: 855882})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 193888969
| mem: 951610})
({cpu: 181456969
| mem: 873910})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 224624840
| mem: 1108814})
({cpu: 209984840
| mem: 1017314})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 186503250
| mem: 900070})
({cpu: 175511250
| mem: 831370})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 207079582
| mem: 1008120})
({cpu: 194359582
| mem: 928620})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 203554074
| mem: 988490})
({cpu: 191410074
| mem: 912590})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 216190138
| mem: 1059440})
({cpu: 202894138
| mem: 976340})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 183983314
| mem: 876474})
({cpu: 173567314
| mem: 811374})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 181144008
| mem: 865550})
({cpu: 170728008
| mem: 800450})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 185132372
| mem: 884970})
({cpu: 174716372
| mem: 819870})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 180666985
| mem: 865342})
({cpu: 170346985
| mem: 800842})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 203304930
| mem: 979538})
({cpu: 191352930
| mem: 904838})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 194050135
| mem: 932022})
({cpu: 182962135
| mem: 862722})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 205436751
| mem: 1000512})
({cpu: 192812751
| mem: 921612})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 183983314
| mem: 876474})
({cpu: 173567314
| mem: 811374})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 177363297
| mem: 852316})
({cpu: 167043297
| mem: 787816})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 195898258
| mem: 947906})
({cpu: 184138258
| mem: 874406})
Loading

1 comment on commit d05da89

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: d05da89 Previous: 2e69d91 Ratio
validation-decode-auction_1-4 195.2 μs 183.9 μs 1.06
validation-decode-auction_2-4 540.8 μs 511.3 μs 1.06
validation-decode-auction_2-5 195.5 μs 183.7 μs 1.06
validation-decode-future-pay-out-2 322 μs 303.8 μs 1.06
validation-decode-future-settle-early-2 321.7 μs 303.5 μs 1.06
validation-decode-game-sm-success_1-2 164.4 μs 154.8 μs 1.06
validation-decode-game-sm-success_1-4 164.3 μs 155.2 μs 1.06
validation-decode-game-sm-success_2-6 164.4 μs 154.2 μs 1.07
validation-decode-multisig-sm-10 584.2 μs 553.5 μs 1.06

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.