Miek Gieben
68b45f5377
plugin/cache: unroll minTTL loop (#1773)
This allocates memory because of the append, just unroll the loop.
Also add benchmark.
Before:
goos: linux
goarch: amd64
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-4 100000 11910 ns/op
BenchmarkMinMsgTTL-4 1000000 1494 ns/op
PASS
After:
goos: linux
goarch: amd64
pkg: github.com/coredns/coredns/plugin/cache
BenchmarkCacheResponse-4 100000 12016 ns/op
BenchmarkMinMsgTTL-4 2000000 668 ns/op
PASS
2018-05-08 18:36:29 +01:00
..
2018-05-01 21:04:06 +01:00
2018-05-07 23:47:25 +02:00
2018-05-07 23:47:25 +02:00
2018-05-08 18:36:29 +01:00
2018-04-22 08:34:35 +01:00
2018-04-19 07:41:56 +01:00
2018-03-01 06:49:52 -08:00
2018-05-07 23:47:25 +02:00
2018-05-07 23:47:25 +02:00
2018-05-01 21:04:06 +01:00
2018-04-22 08:34:35 +01:00
2018-05-07 23:47:25 +02:00
2018-05-01 21:04:06 +01:00
2018-05-07 23:47:25 +02:00
2018-05-04 22:45:58 +02:00
2018-04-26 08:44:33 +01:00
2018-05-01 21:04:06 +01:00
2018-05-01 21:04:06 +01:00
2018-04-22 21:40:33 +01:00
2018-04-22 08:34:35 +01:00
2018-05-05 19:47:41 +02:00
2018-04-22 08:34:35 +01:00
2018-05-08 18:35:47 +01:00
2018-04-30 20:53:23 +01:00
2018-05-07 23:47:25 +02:00
2018-04-22 21:40:33 +01:00
2018-05-01 21:04:06 +01:00
2018-04-27 07:05:44 +01:00
2018-04-22 21:40:33 +01:00
2018-05-01 21:04:06 +01:00
2018-02-16 09:44:50 +01:00
2018-05-01 21:04:06 +01:00
2018-05-07 23:47:25 +02:00
2018-05-04 22:45:58 +02:00
2018-04-25 15:27:25 +01:00
2018-05-01 21:04:06 +01:00
2018-05-01 21:04:06 +01:00
2018-04-22 08:34:35 +01:00
2017-10-24 10:16:03 +01:00
2018-01-23 15:58:36 +00:00
2018-04-22 08:34:35 +01:00