Closed kcalvinalvin closed 1 year ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
blockchain/utxoviewpoint.go | 13 | 21 | 61.9% | ||
<!-- | Total: | 17 | 25 | 68.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
peer/peer.go | 4 | 73.2% | ||
<!-- | Total: | 4 | --> |
Totals | |
---|---|
Change from base Build 4755006470: | -0.009% |
Covered Lines: | 26649 |
Relevant Lines: | 48220 |
Addressed the reviews in the latest push
Pushed an extra commit with benchmarks.
I'm seeing a ~25% performance improvement.
[N] calvin@bitcoin ~/b/g/u/g/s/g/b/b/blockchain (utxoview-use-slices)> go test -run=XXX -bench=BenchmarkUtxo
goos: linux
goarch: amd64
pkg: github.com/btcsuite/btcd/blockchain
cpu: AMD Ryzen 5 3600 6-Core Processor
BenchmarkUtxoFetchMap-10 17066674 71.06 ns/op
BenchmarkUtxoFetchSlices-10 19618462 52.60 ns/op
PASS
ok github.com/btcsuite/btcd/blockchain 2.384s
Maps have a higher overhead than slices. As slices can be used instead of maps, we avoid the overhead of making a map.
This was one of the overheads I've noticed when profiling ibd for PR #1955