Miek Gieben
f8551df272
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>
2019-10-03 15:05:44 +01:00
..
2019-10-01 07:41:29 +01:00
2019-09-20 08:02:30 +01:00
2019-10-01 07:41:29 +01:00
2019-09-26 13:19:45 +01:00
2019-09-20 08:02:30 +01:00
2019-09-28 10:40:43 +01:00
2019-10-03 15:05:44 +01:00
2019-10-01 07:41:29 +01:00
2019-09-20 08:02:30 +01:00
2019-10-02 15:18:36 -07:00
2019-09-28 10:40:43 +01:00
2019-09-20 08:02:30 +01:00
2019-10-01 07:41:29 +01:00
2019-10-01 07:41:29 +01:00
2019-10-02 07:22:26 +01:00
2019-09-20 08:02:30 +01:00
2019-10-01 07:41:29 +01:00
2019-10-01 13:22:42 +01:00
2019-10-01 20:45:52 +01:00
2019-09-28 10:41:12 +01:00
2019-09-23 14:40:14 +01:00
2019-09-25 13:23:43 +01:00
2019-09-08 08:25:17 +01:00
2019-09-23 14:40:14 +01:00
2019-09-27 11:10:34 +01:00
2019-09-26 13:19:45 +01:00
2019-09-20 08:02:30 +01:00
2019-09-20 08:02:30 +01:00
2019-09-20 08:02:30 +01:00
2019-09-20 08:02:30 +01:00
2019-09-20 08:02:30 +01:00
2019-08-28 09:41:11 -04:00
2019-09-20 08:02:30 +01:00
2019-09-26 13:19:45 +01:00
2019-09-27 11:10:47 +01:00
2019-10-01 07:41:29 +01:00
2019-09-28 10:40:43 +01:00
2019-10-03 07:21:11 +01:00
2019-09-26 13:19:45 +01:00
2019-09-20 08:02:30 +01:00
2019-10-01 07:41:29 +01:00
2019-09-23 14:40:14 +01:00
2019-09-28 10:40:43 +01:00
2019-10-01 07:41:29 +01:00
2019-09-20 08:02:30 +01:00
2019-09-05 09:07:55 -04:00
2019-03-26 14:37:30 +00:00
2019-08-24 18:14:25 +00:00
2018-07-19 16:23:06 +01:00
2019-01-19 11:23:13 +00:00
2019-08-21 16:08:55 -04:00
2019-08-21 16:08:55 -04:00
2019-09-20 08:02:30 +01:00