Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix poor performance and long compile times in value_note.dere…
…ment() (#6523) #6405 added a very complicated call (`get_npk_m_hash`) to `destroy_note`, not realizing that `destroy_note` is called in a loop by `decrement`. The loop unrolling caused multiple calls to this function, even though they all had the same arguments, ultimately resulting in humongous RAM usage during compilation (over 40GB just for this contract) and very compilation times (from 30s to multiple minutes). This PR fixes this simply inlining the code for `destroy_note` and fetching the key once at the beginning. It does worry me slightly however that such a large performance hit was not noticed - this likely affected test times as well.
- Loading branch information