Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Optimization] Remove case-of-case #6248

Merged
merged 2 commits into from
Jun 27, 2024
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
----------------------------------------------------------------------
- 712 (4.3%) 1220773236 (12.2%) 47949 (0.3%)
- 714 (4.4%) 1220805236 (12.2%) 48149 (0.3%)

G1 Verify

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

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 1704 (10.4%) 3446243236 (34.5%) 421586 (3.0%)
- 1705 (10.4%) 3446371236 (34.5%) 422386 (3.0%)

Schnorr Signature G1

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 370 (2.3%) 320182564 (3.2%) 13796 (0.1%)
- 371 (2.3%) 320214564 (3.2%) 13996 (0.1%)

Schnorr Signature G2

n Script size CPU usage Memory usage
----------------------------------------------------------------------
- 514 (3.1%) 552393171 (5.5%) 13964 (0.1%)
- 515 (3.1%) 552425171 (5.5%) 14164 (0.1%)

Groth16Verify succeeded
Simple Verify succeeded
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 481 (2.9%) 4458441 (0.0%) 21522 (0.2%)
10 2208 (13.5%) 646843741 (6.5%) 516352 (3.7%)
20 3935 (24.0%) 1289229041 (12.9%) 1011182 (7.2%)
30 5662 (34.6%) 1931614341 (19.3%) 1506012 (10.8%)
40 7389 (45.1%) 2573999641 (25.7%) 2000842 (14.3%)
50 9115 (55.6%) 3216384941 (32.2%) 2495672 (17.8%)
60 10842 (66.2%) 3858770241 (38.6%) 2990502 (21.4%)
70 12569 (76.7%) 4501155541 (45.0%) 3485332 (24.9%)
80 14295 (87.2%) 5143540841 (51.4%) 3980162 (28.4%)
90 16022 (97.8%) 5785926141 (57.9%) 4474992 (32.0%)
100 17749 (108.3%) 6428311441 (64.3%) 4969822 (35.5%)
110 19476 (118.9%) 7070696741 (70.7%) 5464652 (39.0%)
120 21202 (129.4%) 7713082041 (77.1%) 5959482 (42.6%)
130 22929 (139.9%) 8355467341 (83.6%) 6454312 (46.1%)
140 24656 (150.5%) 8997852641 (90.0%) 6949142 (49.6%)
150 26383 (161.0%) 9640237941 (96.4%) 7443972 (53.2%)
0 486 (3.0%) 4490441 (0.0%) 21722 (0.2%)
10 2213 (13.5%) 647515741 (6.5%) 520552 (3.7%)
20 3940 (24.0%) 1290541041 (12.9%) 1019382 (7.3%)
30 5667 (34.6%) 1933566341 (19.3%) 1518212 (10.8%)
40 7394 (45.1%) 2576591641 (25.8%) 2017042 (14.4%)
50 9120 (55.7%) 3219616941 (32.2%) 2515872 (18.0%)
60 10847 (66.2%) 3862642241 (38.6%) 3014702 (21.5%)
70 12574 (76.7%) 4505667541 (45.1%) 3513532 (25.1%)
80 14300 (87.3%) 5148692841 (51.5%) 4012362 (28.7%)
90 16027 (97.8%) 5791718141 (57.9%) 4511192 (32.2%)
100 17754 (108.4%) 6434743441 (64.3%) 5010022 (35.8%)
110 19481 (118.9%) 7077768741 (70.8%) 5508852 (39.3%)
120 21207 (129.4%) 7720794041 (77.2%) 6007682 (42.9%)
130 22934 (140.0%) 8363819341 (83.6%) 6506512 (46.5%)
140 24661 (150.5%) 9006844641 (90.1%) 7005342 (50.0%)
150 26388 (161.1%) 9649869941 (96.5%) 7504172 (53.6%)

Off-chain version succeeded on 100 inputs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 196086904
| mem: 837952})
({cpu: 199606904
| mem: 859952})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 16341428194
| mem: 69498232})
({cpu: 16664628194
| mem: 71518232})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 58837074
| mem: 253492})
({cpu: 59797074
| mem: 259492})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 4173000144
| mem: 17753632})
({cpu: 4254600144
| mem: 18263632})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 113745780
| mem: 538480})
({cpu: 117905780
| mem: 564480})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 8662950900
| mem: 39539800})
({cpu: 8992550900
| mem: 41599800})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 36645190
| mem: 178640})
({cpu: 37925190
| mem: 186640})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 2238212500
| mem: 10264400})
({cpu: 2323012500
| mem: 10794400})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 272684232
| mem: 1083930})
({cpu: 279116232
| mem: 1124130})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 277484232
| mem: 1113930})
({cpu: 283916232
| mem: 1154130})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 185634074
| mem: 876490})
({cpu: 193314074
| mem: 924490})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 274904136
| mem: 1373904})
({cpu: 282840136
| mem: 1423504})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 200204188
| mem: 956454})
({cpu: 207116188
| mem: 999654})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 160863938
| mem: 747222})
({cpu: 167775938
| mem: 790422})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 181505946
| mem: 850332})
({cpu: 189185946
| mem: 898332})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 168188754
| mem: 778272})
({cpu: 175996754
| mem: 827072})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 167027055
| mem: 771670})
({cpu: 174835055
| mem: 820470})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 211814344
| mem: 1011576})
({cpu: 219110344
| mem: 1057176})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 195879877
| mem: 931044})
({cpu: 203687877
| mem: 979844})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 180062226
| mem: 842410})
({cpu: 187486226
| mem: 888810})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 200758582
| mem: 953594})
({cpu: 208438582
| mem: 1001594})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 202287269
| mem: 970170})
({cpu: 209583269
| mem: 1015770})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 240745580
| mem: 1178698})
({cpu: 248425580
| mem: 1226698})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 164932760
| mem: 766344})
({cpu: 172228760
| mem: 811944})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 178424220
| mem: 838008})
({cpu: 185720220
| mem: 883608})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 157679050
| mem: 714766})
({cpu: 165359050
| mem: 762766})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 201678300
| mem: 974642})
({cpu: 208590300
| mem: 1017842})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 174860232
| mem: 818382})
({cpu: 181772232
| mem: 861582})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 177120969
| mem: 846810})
({cpu: 183648969
| mem: 887610})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 205776840
| mem: 991014})
({cpu: 212688840
| mem: 1034214})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 169575250
| mem: 794270})
({cpu: 176487250
| mem: 837470})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 189127582
| mem: 895920})
({cpu: 196423582
| mem: 941520})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 185634074
| mem: 876490})
({cpu: 193314074
| mem: 924490})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 197854138
| mem: 944840})
({cpu: 205534138
| mem: 992840})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 166703314
| mem: 768474})
({cpu: 174383314
| mem: 816474})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 164120008
| mem: 759150})
({cpu: 171544008
| mem: 805550})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 167852372
| mem: 776970})
({cpu: 175532372
| mem: 824970})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 163770985
| mem: 759742})
({cpu: 171066985
| mem: 805342})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 184968930
| mem: 864938})
({cpu: 192648930
| mem: 912938})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 176354135
| mem: 821422})
({cpu: 184034135
| mem: 869422})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 187484751
| mem: 888312})
({cpu: 194780751
| mem: 933912})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 166703314
| mem: 768474})
({cpu: 174383314
| mem: 816474})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 160851297
| mem: 749116})
({cpu: 167763297
| mem: 792316})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 178586258
| mem: 839706})
({cpu: 185882258
| mem: 885306})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 164932684
| mem: 766344})
({cpu: 172228684
| mem: 811944})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 164932684
| mem: 766344})
({cpu: 172228684
| mem: 811944})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
({cpu: 203752158
| mem: 977312})
({cpu: 211560158
| mem: 1026112})
Loading