Skip to content

Commit

Permalink
build: lower optimizer runs (#1144)
Browse files Browse the repository at this point in the history
* build: lower the optimizer_runs to fit within the size limit

* build: set optimizer runs to 570
chore: update precompiles, gas benchmarks and max segment value in base script

---------

Co-authored-by: smol-ninja <[email protected]>
  • Loading branch information
andreivladbrg and smol-ninja committed Jan 14, 2025
1 parent 937bd94 commit 076eba9
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 112 deletions.
60 changes: 30 additions & 30 deletions benchmark/results/SablierBatchLockup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

| Function | Lockup Type | Segments/Tranches | Batch Size | Gas Usage |
| ------------------------ | --------------- | ----------------- | ---------- | --------- |
| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 903159 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 5 | 861441 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 5 | 4120769 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 5 | 3891095 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 3996698 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3809816 |
| `createWithDurationsLL` | Lockup Linear | N/A | 10 | 1673021 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 10 | 1672189 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 8197426 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7733344 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7941453 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7571162 |
| `createWithDurationsLL` | Lockup Linear | N/A | 20 | 3296857 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 3295805 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 20 | 16367660 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 20 | 15422847 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 20 | 15829541 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 20 | 15098785 |
| `createWithDurationsLL` | Lockup Linear | N/A | 30 | 4918016 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 30 | 4924864 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 30 | 24577948 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 30 | 23127215 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 30 | 23717265 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 30 | 22641404 |
| `createWithDurationsLL` | Lockup Linear | N/A | 50 | 8178730 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 50 | 8190836 |
| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 24075414 |
| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 22851294 |
| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 23330071 |
| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22477363 |
| `createWithDurationsLL` | Lockup Linear | N/A | 5 | 937003 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 5 | 898916 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 5 | 4123217 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 5 | 3895052 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 5 | 4013105 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 5 | 3822707 |
| `createWithDurationsLL` | Lockup Linear | N/A | 10 | 1740955 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 10 | 1747416 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 10 | 8202890 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 10 | 7741699 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 10 | 7974447 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 10 | 7597402 |
| `createWithDurationsLL` | Lockup Linear | N/A | 20 | 3433786 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 20 | 3447467 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 20 | 16380960 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 20 | 15440827 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 20 | 15896070 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 20 | 15152551 |
| `createWithDurationsLL` | Lockup Linear | N/A | 30 | 5125959 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 30 | 5155292 |
| `createWithDurationsLD` | Lockup Dynamic | 24 | 30 | 24603376 |
| `createWithTimestampsLD` | Lockup Dynamic | 24 | 30 | 23157026 |
| `createWithDurationsLT` | Lockup Tranched | 24 | 30 | 23818565 |
| `createWithTimestampsLT` | Lockup Tranched | 24 | 30 | 22725003 |
| `createWithDurationsLL` | Lockup Linear | N/A | 50 | 8532644 |
| `createWithTimestampsLL` | Lockup Linear | N/A | 50 | 8582221 |
| `createWithDurationsLD` | Lockup Dynamic | 12 | 50 | 24275049 |
| `createWithTimestampsLD` | Lockup Dynamic | 12 | 50 | 23058857 |
| `createWithDurationsLT` | Lockup Tranched | 12 | 50 | 23611123 |
| `createWithTimestampsLT` | Lockup Tranched | 12 | 50 | 22718936 |
54 changes: 27 additions & 27 deletions benchmark/results/SablierLockup_Dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

| Implementation | Gas Usage |
| ------------------------------------------------------------ | --------- |
| `burn` | 15791 |
| `cancel` | 65885 |
| `renounce` | 27466 |
| `createWithDurationsLD` (2 segments) (Broker fee set) | 211605 |
| `createWithDurationsLD` (2 segments) (Broker fee not set) | 195353 |
| `createWithTimestampsLD` (2 segments) (Broker fee set) | 192136 |
| `createWithTimestampsLD` (2 segments) (Broker fee not set) | 187185 |
| `withdraw` (2 segments) (After End Time) (by Recipient) | 19121 |
| `withdraw` (2 segments) (Before End Time) (by Recipient) | 28328 |
| `withdraw` (2 segments) (After End Time) (by Anyone) | 14377 |
| `withdraw` (2 segments) (Before End Time) (by Anyone) | 28384 |
| `createWithDurationsLD` (10 segments) (Broker fee set) | 419147 |
| `createWithDurationsLD` (10 segments) (Broker fee not set) | 414209 |
| `createWithTimestampsLD` (10 segments) (Broker fee set) | 398718 |
| `createWithTimestampsLD` (10 segments) (Broker fee not set) | 393783 |
| `withdraw` (10 segments) (After End Time) (by Recipient) | 14308 |
| `withdraw` (10 segments) (Before End Time) (by Recipient) | 35631 |
| `withdraw` (10 segments) (After End Time) (by Anyone) | 14385 |
| `withdraw` (10 segments) (Before End Time) (by Anyone) | 35687 |
| `createWithDurationsLD` (100 segments) (Broker fee set) | 2919492 |
| `createWithDurationsLD` (100 segments) (Broker fee not set) | 2915538 |
| `createWithTimestampsLD` (100 segments) (Broker fee set) | 2727003 |
| `createWithTimestampsLD` (100 segments) (Broker fee not set) | 2723074 |
| `withdraw` (100 segments) (After End Time) (by Recipient) | 14308 |
| `withdraw` (100 segments) (Before End Time) (by Recipient) | 118217 |
| `withdraw` (100 segments) (After End Time) (by Anyone) | 14364 |
| `withdraw` (100 segments) (Before End Time) (by Anyone) | 118273 |
| `burn` | 16141 |
| `cancel` | 65381 |
| `renounce` | 27721 |
| `createWithDurationsLD` (2 segments) (Broker fee set) | 216788 |
| `createWithDurationsLD` (2 segments) (Broker fee not set) | 200461 |
| `createWithTimestampsLD` (2 segments) (Broker fee set) | 197652 |
| `createWithTimestampsLD` (2 segments) (Broker fee not set) | 192627 |
| `withdraw` (2 segments) (After End Time) (by Recipient) | 23885 |
| `withdraw` (2 segments) (Before End Time) (by Recipient) | 29903 |
| `withdraw` (2 segments) (After End Time) (by Anyone) | 19175 |
| `withdraw` (2 segments) (Before End Time) (by Anyone) | 29992 |
| `createWithDurationsLD` (10 segments) (Broker fee set) | 422199 |
| `createWithDurationsLD` (10 segments) (Broker fee not set) | 417189 |
| `createWithTimestampsLD` (10 segments) (Broker fee set) | 402125 |
| `createWithTimestampsLD` (10 segments) (Broker fee not set) | 397126 |
| `withdraw` (10 segments) (After End Time) (by Recipient) | 24167 |
| `withdraw` (10 segments) (Before End Time) (by Recipient) | 37190 |
| `withdraw` (10 segments) (After End Time) (by Anyone) | 24278 |
| `withdraw` (10 segments) (Before End Time) (by Anyone) | 37279 |
| `createWithDurationsLD` (100 segments) (Broker fee set) | 2898563 |
| `createWithDurationsLD` (100 segments) (Broker fee not set) | 2894573 |
| `createWithTimestampsLD` (100 segments) (Broker fee set) | 2706641 |
| `createWithTimestampsLD` (100 segments) (Broker fee not set) | 2702660 |
| `withdraw` (100 segments) (After End Time) (by Recipient) | 81920 |
| `withdraw` (100 segments) (Before End Time) (by Recipient) | 119603 |
| `withdraw` (100 segments) (After End Time) (by Anyone) | 82009 |
| `withdraw` (100 segments) (Before End Time) (by Anyone) | 119692 |
30 changes: 15 additions & 15 deletions benchmark/results/SablierLockup_Linear.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

| Implementation | Gas Usage |
| ------------------------------------------------------------- | --------- |
| `burn` | 15791 |
| `cancel` | 65885 |
| `renounce` | 27466 |
| `createWithDurationsLL` (Broker fee set) (cliff not set) | 133431 |
| `createWithDurationsLL` (Broker fee not set) (cliff not set) | 117148 |
| `createWithDurationsLL` (Broker fee set) (cliff set) | 163961 |
| `createWithDurationsLL` (Broker fee not set) (cliff set) | 158978 |
| `createWithTimestampsLL` (Broker fee set) (cliff not set) | 118944 |
| `createWithTimestampsLL` (Broker fee not set) (cliff not set) | 113957 |
| `createWithTimestampsLL` (Broker fee set) (cliff set) | 163481 |
| `createWithTimestampsLL` (Broker fee not set) (cliff set) | 158494 |
| `withdraw` (After End Time) (by Recipient) | 29508 |
| `withdraw` (Before End Time) (by Recipient) | 21608 |
| `withdraw` (After End Time) (by Anyone) | 24764 |
| `withdraw` (Before End Time) (by Anyone) | 21420 |
| `burn` | 16141 |
| `cancel` | 65381 |
| `renounce` | 27721 |
| `createWithDurationsLL` (Broker fee set) (cliff not set) | 138649 |
| `createWithDurationsLL` (Broker fee not set) (cliff not set) | 122287 |
| `createWithDurationsLL` (Broker fee set) (cliff set) | 169335 |
| `createWithDurationsLL` (Broker fee not set) (cliff set) | 164278 |
| `createWithTimestampsLL` (Broker fee set) (cliff not set) | 125100 |
| `createWithTimestampsLL` (Broker fee not set) (cliff not set) | 120038 |
| `createWithTimestampsLL` (Broker fee set) (cliff set) | 169682 |
| `createWithTimestampsLL` (Broker fee not set) (cliff set) | 164614 |
| `withdraw` (After End Time) (by Recipient) | 33179 |
| `withdraw` (Before End Time) (by Recipient) | 23303 |
| `withdraw` (After End Time) (by Anyone) | 29561 |
| `withdraw` (Before End Time) (by Anyone) | 22815 |
54 changes: 27 additions & 27 deletions benchmark/results/SablierLockup_Tranched.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

| Implementation | Gas Usage |
| ------------------------------------------------------------ | --------- |
| `burn` | 15791 |
| `cancel` | 65885 |
| `renounce` | 27466 |
| `createWithDurationsLT` (2 tranches) (Broker fee set) | 209723 |
| `createWithDurationsLT` (2 tranches) (Broker fee not set) | 193473 |
| `createWithTimestampsLT` (2 tranches) (Broker fee set) | 191747 |
| `createWithTimestampsLT` (2 tranches) (Broker fee not set) | 186795 |
| `withdraw` (2 tranches) (After End Time) (by Recipient) | 19121 |
| `withdraw` (2 tranches) (Before End Time) (by Recipient) | 16808 |
| `withdraw` (2 tranches) (After End Time) (by Anyone) | 14378 |
| `withdraw` (2 tranches) (Before End Time) (by Anyone) | 16864 |
| `createWithDurationsLT` (10 tranches) (Broker fee set) | 409546 |
| `createWithDurationsLT` (10 tranches) (Broker fee not set) | 404601 |
| `createWithTimestampsLT` (10 tranches) (Broker fee set) | 393063 |
| `createWithTimestampsLT` (10 tranches) (Broker fee not set) | 388126 |
| `withdraw` (10 tranches) (After End Time) (by Recipient) | 14321 |
| `withdraw` (10 tranches) (Before End Time) (by Recipient) | 23704 |
| `withdraw` (10 tranches) (After End Time) (by Anyone) | 14384 |
| `withdraw` (10 tranches) (Before End Time) (by Anyone) | 23760 |
| `createWithDurationsLT` (100 tranches) (Broker fee set) | 2819619 |
| `createWithDurationsLT` (100 tranches) (Broker fee not set) | 2815177 |
| `createWithTimestampsLT` (100 tranches) (Broker fee set) | 2659961 |
| `createWithTimestampsLT` (100 tranches) (Broker fee not set) | 2655537 |
| `withdraw` (100 tranches) (After End Time) (by Recipient) | 14308 |
| `withdraw` (100 tranches) (Before End Time) (by Recipient) | 101639 |
| `withdraw` (100 tranches) (After End Time) (by Anyone) | 14364 |
| `withdraw` (100 tranches) (Before End Time) (by Anyone) | 101695 |
| `burn` | 16141 |
| `cancel` | 65381 |
| `renounce` | 27721 |
| `createWithDurationsLT` (2 tranches) (Broker fee set) | 215994 |
| `createWithDurationsLT` (2 tranches) (Broker fee not set) | 199665 |
| `createWithTimestampsLT` (2 tranches) (Broker fee set) | 196988 |
| `createWithTimestampsLT` (2 tranches) (Broker fee not set) | 191964 |
| `withdraw` (2 tranches) (After End Time) (by Recipient) | 23599 |
| `withdraw` (2 tranches) (Before End Time) (by Recipient) | 18503 |
| `withdraw` (2 tranches) (After End Time) (by Anyone) | 18889 |
| `withdraw` (2 tranches) (Before End Time) (by Anyone) | 18592 |
| `createWithDurationsLT` (10 tranches) (Broker fee set) | 414411 |
| `createWithDurationsLT` (10 tranches) (Broker fee not set) | 409394 |
| `createWithTimestampsLT` (10 tranches) (Broker fee set) | 397045 |
| `createWithTimestampsLT` (10 tranches) (Broker fee not set) | 392026 |
| `withdraw` (10 tranches) (After End Time) (by Recipient) | 23318 |
| `withdraw` (10 tranches) (Before End Time) (by Recipient) | 25403 |
| `withdraw` (10 tranches) (After End Time) (by Anyone) | 23427 |
| `withdraw` (10 tranches) (Before End Time) (by Anyone) | 25492 |
| `createWithDurationsLT` (100 tranches) (Broker fee set) | 2808652 |
| `createWithDurationsLT` (100 tranches) (Broker fee not set) | 2804166 |
| `createWithTimestampsLT` (100 tranches) (Broker fee set) | 2649659 |
| `createWithTimestampsLT` (100 tranches) (Broker fee not set) | 2645177 |
| `withdraw` (100 tranches) (After End Time) (by Recipient) | 74530 |
| `withdraw` (100 tranches) (Before End Time) (by Recipient) | 103255 |
| `withdraw` (100 tranches) (After End Time) (by Anyone) | 74619 |
| `withdraw` (100 tranches) (Before End Time) (by Anyone) | 103344 |
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]
gas_limit = 9223372036854775807
optimizer = true
optimizer_runs = 800
optimizer_runs = 570
out = "out"
script = "script"
sender = "0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38"
Expand Down
Loading

0 comments on commit 076eba9

Please sign in to comment.