Commit Graph

2 Commits (8e56b3ff1e5e49035f6f10147d692b47ecbd65f2)

Author SHA1 Message Date
Cameron Sparr fa2b78d67e Optimize string escaping & unescaping
benchmarks pre-commit:

go test ./pkg/escape/... -bench=. -benchmem
BenchmarkStringEscapeNoEscapes-8         10000000          122 ns/op     0 B/op      0 allocs/op
BenchmarkStringUnescapeNoEscapes-8       300000000         5.69 ns/op    0 B/op      0 allocs/op
BenchmarkManyStringEscape-8               1000000          1073 ns/op    320 B/op    8 allocs/op
BenchmarkManyStringUnescape-8             1000000          1557 ns/op    288 B/op    8 allocs/op
PASS
ok      github.com/influxdata/influxdb/pkg/escape    6.304s

benchmarks post-commit:

go test ./pkg/escape/... -bench=. -benchmem
BenchmarkStringEscapeNoEscapes-8         100000000         17.5 ns/op    0 B/op      0 allocs/op
BenchmarkStringUnescapeNoEscapes-8       300000000         5.70 ns/op    0 B/op      0 allocs/op
BenchmarkManyStringEscape-8               3000000          451 ns/op     224 B/op    6 allocs/op
BenchmarkManyStringUnescape-8             2000000          944 ns/op     304 B/op    9 allocs/op
PASS
ok      github.com/influxdata/influxdb/pkg/escape    8.727s
2016-11-24 10:25:35 +00:00
Cameron Sparr 3fe0ffd5ad String escape unit tests 2016-11-18 16:02:52 +00:00