coredns/plugin/pkg
Charlie Vieth a2af651ecb replacer: evaluate format once and improve perf by ~3x (#3002)
* replacer: evaluate format once and improve perf by ~3x

This improves the performance of logging by almost 3x and reduces memory
usage by ~8x.

Benchmark results:

benchmark                                old ns/op     new ns/op     delta
BenchmarkReplacer-12                     644           324           -49.69%
BenchmarkReplacer_CommonLogFormat-12     4228          1471          -65.21%

benchmark                                old allocs     new allocs     delta
BenchmarkReplacer-12                     8              2              -75.00%
BenchmarkReplacer_CommonLogFormat-12     51             17             -66.67%

benchmark                                old bytes     new bytes     delta
BenchmarkReplacer-12                     240           48            -80.00%
BenchmarkReplacer_CommonLogFormat-12     3723          446           -88.02%

* replacer: code review comments

* bufPool: document why we use a pointer to a slice
* parseFormat: fix confusing comment
* TestParseFormat_Nodes: rename to TestParseFormatNodes

* replacer: use a value for bufPool instead of a pointer

* replacer: remove comment

* replacer: replace labels with knownLabels

The previous slice of label names is no longer needed.
2019-07-17 06:57:46 +00:00
..
cache Move cache Keys to 64bit for a better dispersion and lower collision frequency (#2077) 2018-08-31 14:26:43 -07:00
dnstest retry creating dnstest.Server if tcp or udp port is in use (#1799) 2018-06-22 10:54:40 +01:00
dnsutil plugin/cache: fix TTL for negative DNS responses (#2197) 2018-10-19 14:10:08 -04:00
doh Typo fixes (#2031) 2018-08-14 08:55:55 -07:00
edns edns0 compliance: set correct RCODE (#2388) 2018-12-11 20:27:29 +00:00
fall pkg/fall: make Zero and Root vars not funcs (#1367) 2018-01-09 22:29:19 +00:00
fuzz all: fix plugin import ordering (#1717) 2018-04-22 08:34:35 +01:00
log pkg/log: fix data race on d (#2698) 2019-05-23 21:02:30 +01:00
nonwriter Revert pkg/nonwriter changes (#1829) 2018-05-23 08:50:27 -04:00
parse Update Caddy to 1.0.1, and update import path (#2961) 2019-07-03 09:04:47 +08:00
rcode doc: some function/vars/const/package level updates (#1558) 2018-02-23 15:02:05 +00:00
replacer replacer: evaluate format once and improve perf by ~3x (#3002) 2019-07-17 06:57:46 +00:00
response [plugin/cache] cache failures (#2720) 2019-04-08 11:15:05 +01:00
singleflight Fix error string should not be capitalized (#2608) 2019-02-27 08:25:02 -05:00
tls Fix t.Error error message (#2551) 2019-02-11 07:23:05 +00:00
trace Remove the word middleware (#1067) 2017-09-14 09:36:06 +01:00
transport Better naming (#2104) 2018-09-19 08:16:04 +01:00
uniq plugin/ready: fix starts and restarts (#2814) 2019-06-09 08:10:15 +01:00
up pkg/up: implement backoff (#2342) 2018-12-01 09:07:03 +00:00
upstream Remove context.Context from request.Request (#2726) 2019-03-26 14:37:30 +00:00