Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utxocache: pre-size cache to max element size
In this commit, we pre-allocate our cache to hold the maximum number of entries possible. We do this for two reasons: 1. Go maps do not shrink when items are deleted from there, so we'll end up with a map of this size anyway. 2. By doing our large allocation, we avoid doing many smaller allocations causing more GC pressure as we ramp up to our max cache size. To estimate the max size of the cache, we use the length of a p2pkh script since they're larger than p2wkh scripts, and p2wkh isn't as widespread yet.
- Loading branch information