You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4472 caused a regression in reference count tracking in Brillig. increment_rc instructions are issued more often now which caused the size of certain programs to increase quite a bit. Performance can also worsen when these are increased past 1 since this necessitates copies for mutable arrays.
Happy Case
We try to keep reference counts down by:
Introducing a decrement_rc instruction called when an array is last used
Possibly introducing a reference count removal optimization pass. The classic example of this is removing paired inc/dec instructions where they're unneeded - e.g. the array is not mutated. We could also consider trying to add this without the decrement instruction since it is possible to borrow an array without mutating it. Care just needs to be taken to ensure the borrowed array doesn't live on after the function call.
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
# Description
## Problem\*
Resolves#4522
## Summary\*
Experimenting with this to see how much it improves performance of
unconstrained code using arrays.
## Additional Context
Currently the new dec_rc instruction is only issued for function
parameters when a function is finished - assuming the parameters are not
also returned.
CC @sirasistant for visibility
## Documentation\*
Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.
# PR Checklist\*
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
---------
Co-authored-by: Álvaro Rodríguez <sirasistant@gmail.com>
Problem
#4472 caused a regression in reference count tracking in Brillig. increment_rc instructions are issued more often now which caused the size of certain programs to increase quite a bit. Performance can also worsen when these are increased past 1 since this necessitates copies for mutable arrays.
Happy Case
We try to keep reference counts down by:
Project Impact
None
Impact Context
No response
Workaround
None
Workaround Description
No response
Additional Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: