feat: optimize array reads from length 1 arrays#9203
Conversation
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Memory'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 09613b1 | Previous: b331315 | Ratio |
|---|---|---|---|
rollup-base-private |
714.77 MB |
502.19 MB |
1.42 |
rollup-base-public |
601.01 MB |
435.05 MB |
1.38 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 971dc19 | Previous: b331315 | Ratio |
|---|---|---|---|
test_report_AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob |
235 s |
170 s |
1.38 |
test_report_zkpassport_noir_rsa_ |
2 s |
1 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Changes to number of Brillig opcodes executed
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Changes to Brillig bytecode sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Description
Problem*
Resolves
Summary*
This optimization deals with a couple of avoidable issues which arose in #9200. If we have a length 1 array then we can just optimistically read from index 0 and inject an assertion that the index will be zero.
This allows us to simplify some later instructions however the results are not shown against master due to #7827 currently injecting constraints which turn all of these array accesses into constant index accesses currently.
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.