diff options
author | 2019-10-03 15:05:44 +0100 | |
---|---|---|
committer | 2019-10-03 15:05:44 +0100 | |
commit | f8551df27284b93e9f95e064ec65a9df60f4a528 (patch) | |
tree | e7d70ac9ede0ad2e37b0d9753bd900c41fb371ee /request | |
parent | aa96d6b443ea58c8f7c80649f76b93e243fbb3f4 (diff) | |
download | coredns-f8551df27284b93e9f95e064ec65a9df60f4a528.tar.gz coredns-f8551df27284b93e9f95e064ec65a9df60f4a528.tar.zst coredns-f8551df27284b93e9f95e064ec65a9df60f4a528.zip |
cache: move goroutine closure to separate function to save memory (#3353)
The goroutine closure was causing objects to be heap allocated. Moving
it to a separate function fixes that.
```benchmark old ns/op new ns/op delta
BenchmarkCacheResponse/NoPrefetch-12 773 713 -7.76%
BenchmarkCacheResponse/Prefetch-12 878 837 -4.67%
BenchmarkHash-12 9.17 9.18 +0.11%
benchmark old allocs new allocs delta
BenchmarkCacheResponse/NoPrefetch-12 9 8 -11.11%
BenchmarkCacheResponse/Prefetch-12 9 8 -11.11%
BenchmarkHash-12 0 0 +0.00%
benchmark old bytes new bytes delta
BenchmarkCacheResponse/NoPrefetch-12 471 327 -30.57%
BenchmarkCacheResponse/Prefetch-12 471 327 -30.57%
BenchmarkHash-12 0 0 +0.00%
```
Signed-off-by: Charlie Vieth <charlie.vieth@gmail.com>
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'request')
0 files changed, 0 insertions, 0 deletions