feat(optimization): Try to optimize ownership of assign statements#8876
feat(optimization): Try to optimize ownership of assign statements#8876
Conversation
Changes to Brillig bytecode sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Changes to number of Brillig opcodes executed
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 46b2647 | Previous: 9580a12 | Ratio |
|---|---|---|---|
rollup-merge |
0.004 s |
0.003 s |
1.33 |
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: 0b56d74 | Previous: 9580a12 | Ratio |
|---|---|---|---|
test_report_noir-lang_noir_bigcurve_ |
268 s |
223 s |
1.20 |
test_report_zkpassport_noir_rsa_ |
2 s |
1 s |
2 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
|
This PR should be ready for review now, I can't seem to find any bugs with the approach here. |
4455f94 to
46b2647
Compare
|
Found a couple of issues with this after thinking of some more cases where the previous value should not be moved. Just checking the loop index is not sufficient since: for _ in 0 .. 10 {
foo(bar);
}
for _ in 0 .. 10 {
bar = &[];
}In the above example if we just check the loop index, it will be |
|
Abandoning this work for now to focus more on fixing bugs before 1.0. |
Description
Problem*
Resolves #8846
Summary*
With this we go from 300 array copies down to 3 (not scaling with loop iterations) for the given test program.
Note that the example program uses slices so #8867 is necessary to count the slice copies.
Additional Context
This is a draft while I verify some corner cases with the assign check.
Documentation*
Check one:
PR Checklist*
cargo fmton default settings.