Skip to content

Improve constant propagate - #7722

Draft
xunilrj wants to merge 7 commits into
masterfrom
xunilrj/improve-constant-propagate
Draft

Improve constant propagate#7722
xunilrj wants to merge 7 commits into
masterfrom
xunilrj/improve-constant-propagate

Conversation

@xunilrj

@xunilrj xunilrj commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

This PR simply choose more optimal "reset knowledge" for cons propagate. We were throwing everything away, which is very suboptimal.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@xunilrj

xunilrj commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Benchmark report

xunilrj/improve-constant-propagate @56d120cb vs master @08dad8c5

e2e-gas-usages

Improvements Regressions
Count 1645
Average 0.23%
Median 0.13%
Max 4.26%
Min 0.01%

Distribution

Histogram for Percentage (bars: 10, sum: 1,790n, max: 1,635n):

>= 0      <  0.426  |1,635n  91.34%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.426  <  0.852  |   92n   5.14%|■■                                 |
>= 0.852  <  1.278  |   10n   0.56%|■                                  |
>= 1.278  <  1.704  |   24n   1.34%|■                                  |
>= 1.704  <  2.13   |    6n   0.34%|■                                  |
>= 2.13   <  2.556  |   15n   0.84%|■                                  |
>= 2.556  <  2.982  |    6n   0.34%|■                                  |
>= 2.982  <  3.4080 |    1n   0.06%|■                                  |
>= 3.4080 <  3.8340 |    0n   0.00%|                                   |
>= 3.8340 <= 4.26   |    1n   0.06%|■                                  |

e2e-bytecode-sizes

Improvements Regressions
Count 86
Average 1.21%
Median 0.68%
Max 5.13%
Min 0.02%

Distribution

Histogram for Percentage (bars: 10, sum: 86n, max: 30n):

>= 0.02   <  0.531  |30n  34.88%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.531  <  1.042  |22n  25.58%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■          |
>= 1.042  <  1.553  |14n  16.28%|■■■■■■■■■■■■■■■■■■                    |
>= 1.553  <  2.064  | 5n   5.81%|■■■■■■■                               |
>= 2.064  <  2.575  | 3n   3.49%|■■■■                                  |
>= 2.575  <  3.0860 | 6n   6.98%|■■■■■■■■                              |
>= 3.0860 <  3.5970 | 1n   1.16%|■■                                    |
>= 3.5970 <  4.1080 | 0n   0.00%|                                      |
>= 4.1080 <  4.6190 | 2n   2.33%|■■■                                   |
>= 4.6190 <= 5.13   | 3n   3.49%|■■■■                                  |

in-language-gas-usages

Improvements Regressions
Count 390
Average 0.96%
Median 0.64%
Max 9.87%
Min 0.01%

Distribution

Histogram for Percentage (bars: 10, sum: 395n, max: 288n):

>= 0      <  0.9869 |288n  72.91%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.9869 <  1.9739 | 78n  19.75%|■■■■■■■■■■■                          |
>= 1.9739 <  2.9609 |  9n   2.28%|■■                                   |
>= 2.9609 <  3.9479 |  8n   2.03%|■■                                   |
>= 3.9479 <  4.935  |  1n   0.25%|■                                    |
>= 4.935  <  5.922  |  0n   0.00%|                                     |
>= 5.922  <  6.909  |  8n   2.03%|■■                                   |
>= 6.909  <  7.896  |  0n   0.00%|                                     |
>= 7.896  <  8.883  |  1n   0.25%|■                                    |
>= 8.883  <= 9.87   |  2n   0.51%|■                                    |

in-language-bytecode-sizes

Improvements Regressions
Count 41
Average 0.72%
Median 0.58%
Max 2.10%
Min 0.08%

Distribution

Histogram for Percentage (bars: 10, sum: 42n, max: 9n):

>= 0      <  0.2100 |7n  16.67%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |
>= 0.2100 <  0.4200 |9n  21.43%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.4200 <  0.6300 |6n  14.29%|■■■■■■■■■■■■■■■■■■■■■■■■■■             |
>= 0.6300 <  0.8400 |8n  19.05%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■    |
>= 0.8400 <  1.05   |4n   9.52%|■■■■■■■■■■■■■■■■■■                     |
>= 1.05   <  1.26   |1n   2.38%|■■■■■                                  |
>= 1.26   <  1.47   |1n   2.38%|■■■■■                                  |
>= 1.47   <  1.68   |3n   7.14%|■■■■■■■■■■■■■                          |
>= 1.68   <  1.89   |2n   4.76%|■■■■■■■■■                              |
>= 1.89   <= 2.1    |1n   2.38%|■■■■■                                  |

fuel-o2-exports / order-book

Improvements Regressions
Count 35
Average 0.53%
Median 0.54%
Max 1.20%
Min 0.29%

Distribution

Histogram for Percentage (bars: 10, sum: 35n, max: 10n):

>= 0.29   <  0.381  | 6n  17.14%|■■■■■■■■■■■■■■■■■■■■■■■               |
>= 0.381  <  0.472  |10n  28.57%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.472  <  0.563  | 4n  11.43%|■■■■■■■■■■■■■■■■                      |
>= 0.563  <  0.6539 |10n  28.57%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.6539 <  0.7449 | 4n  11.43%|■■■■■■■■■■■■■■■■                      |
>= 0.7449 <  0.8359 | 0n   0.00%|                                      |
>= 0.8359 <  0.9269 | 0n   0.00%|                                      |
>= 0.9269 <  1.0179 | 0n   0.00%|                                      |
>= 1.0179 <  1.1089 | 0n   0.00%|                                      |
>= 1.1089 <= 1.1999 | 1n   2.86%|■■■■                                  |

fuel-o2-exports / trade-account

Improvements Regressions
Count 21
Average 0.15%
Median 0.13%
Max 0.31%
Min 0.07%

Distribution

Histogram for Percentage (bars: 10, sum: 21n, max: 8n):

>= 0.07   <  0.094  |2n   9.52%|■■■■■■■■■■                             |
>= 0.094  <  0.118  |3n  14.29%|■■■■■■■■■■■■■■■                        |
>= 0.118  <  0.142  |8n  38.10%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.142  <  0.1659 |1n   4.76%|■■■■■                                  |
>= 0.1659 <  0.1899 |1n   4.76%|■■■■■                                  |
>= 0.1899 <  0.2139 |4n  19.05%|■■■■■■■■■■■■■■■■■■■■                   |
>= 0.2139 <  0.2379 |0n   0.00%|                                       |
>= 0.2379 <  0.2619 |1n   4.76%|■■■■■                                  |
>= 0.2619 <  0.286  |0n   0.00%|                                       |
>= 0.286  <= 0.31   |1n   4.76%|■■■■■                                  |

snapshot-gas-usages

Improvements Regressions
Count 60
Average 0.19%
Median 0.14%
Max 0.80%
Min 0.02%

Distribution

Histogram for Percentage (bars: 10, sum: 60n, max: 20n):

>= 0.02   <  0.098  |15n  25.00%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■         |
>= 0.098  <  0.176  |20n  33.33%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.176  <  0.254  | 8n  13.33%|■■■■■■■■■■■■■■■■                      |
>= 0.254  <  0.332  |11n  18.33%|■■■■■■■■■■■■■■■■■■■■■                 |
>= 0.332  <  0.4100 | 3n   5.00%|■■■■■■                                |
>= 0.4100 <  0.4880 | 2n   3.33%|■■■■                                  |
>= 0.4880 <  0.5660 | 0n   0.00%|                                      |
>= 0.5660 <  0.644  | 0n   0.00%|                                      |
>= 0.644  <  0.722  | 0n   0.00%|                                      |
>= 0.722  <= 0.7999 | 1n   1.67%|■■                                    |

snapshot-bytecode-sizes

Improvements Regressions
Count 9
Average 0.85%
Median 0.41%
Max 3.39%
Min 0.21%

Distribution

Histogram for Percentage (bars: 10, sum: 9n, max: 6n):

>= 0.21   <  0.528  |6n  66.67%|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■|
>= 0.528  <  0.8460 |0n   0.00%|                                       |
>= 0.8460 <  1.1640 |1n  11.11%|■■■■■■■                                |
>= 1.1640 <  1.4820 |0n   0.00%|                                       |
>= 1.4820 <  1.8000 |1n  11.11%|■■■■■■■                                |
>= 1.8000 <  2.1180 |0n   0.00%|                                       |
>= 2.1180 <  2.4360 |0n   0.00%|                                       |
>= 2.4360 <  2.7540 |0n   0.00%|                                       |
>= 2.7540 <  3.0720 |0n   0.00%|                                       |
>= 3.0720 <= 3.39   |1n  11.11%|■■■■■■■                                |

@xunilrj
xunilrj deployed to fuel-sway-bot August 26, 2026 16:48 — with GitHub Actions Active
@codspeed-hq

codspeed-hq Bot commented Aug 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 25 untouched benchmarks


Comparing xunilrj/improve-constant-propagate (9d47e7c) with master (f6f97f0)

Open in CodSpeed

@xunilrj
xunilrj deployed to fuel-sway-bot August 26, 2026 17:16 — with GitHub Actions Active
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant