Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: reduce NewCarReader allocations
This accounted for almost 10% of the garbage on one of Bluesky's server daemons (go tool pprof --alloc_space), leading to high GC CPU. benchstat: │ before │ after │ │ sec/op │ sec/op vs base │ NewCarReader_small-8 2.005µ ± 1% 1.451µ ± 5% -27.61% (p=0.000 n=10) │ before │ after │ │ B/op │ B/op vs base │ NewCarReader_small-8 5.268Ki ± 0% 1.135Ki ± 0% -78.46% (p=0.000 n=10) │ before │ after │ │ allocs/op │ allocs/op vs base │ NewCarReader_small-8 29.00 ± 0% 27.00 ± 0% -6.90% (p=0.000 n=10)
- Loading branch information