Open jfecher opened 5 days ago
Generated at commit: ead9d26d9de6cf44aaf92b573bce2296c991ac01, compared to commit: 1b43b06c81c3d173992fd949bad5df7f2435ba4b
Program | Brillig opcodes (+/-) | % |
---|---|---|
array_sort | -42 โ | -7.17% |
reference_only_used_as_alias | -30 โ | -15.00% |
brillig_rc_regression_6123 | -228 โ | -76.00% |
Generated at commit: ead9d26d9de6cf44aaf92b573bce2296c991ac01, compared to commit: 1b43b06c81c3d173992fd949bad5df7f2435ba4b
Program | Brillig opcodes (+/-) | % |
---|---|---|
hashmap | -666 โ | -3.24% |
reference_only_used_as_alias | -30 โ | -16.76% |
brillig_rc_regression_6123 | -105 โ | -58.66% |
fold_2_to_17 1,168,465 (+21,730) +1.89%
I wonder what more is being executed here? When the only change is to issue fewer inc/decs, reference counts should in theory remain at 1 more often and just lead to more direct mutation.
Description
Problem*
Summary*
We may not need to increment reference counts in parameters at all since https://github.com/noir-lang/noir/pull/6568 eliminates them for arrays, and previously we had eliminated them for references as well, though this was reverted. This PR is speculation that the reversion was only needed because we forgot to also remove the dec_rc in that case, leading to reference counts drifting down too far.
Additional Context
This is passing locally but I think we're missing a inc_rc when dereferencing that is now required with this change. Adding it may be more expensive than just keeping inc_rc for reference parameters though.
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.