This function was doing millions of unnecessary heap allocations during IBD.
I’m start to catalog unnecessary heap allocations as a pet project of mine: as-zero-as-possible-alloc IBD. This is one small step.
before:
after:
should I type alias this? I type aliased it
This is a part of the Zero Allocations Project #18849 (ZAP1). This code came up as a place where many allocations occur.