miekg/dns — pull request #79 by millerkil (2014-01-26 02:28:00+00:00)
Title: Optimize compressionLenHelper

Back with another optimization :)

`compressionLenHelper` was making quite a few string concatenations, so I opted to slice up the original string instead of creating new ones. It improved the performance quite a bit.

Relevant benchmarks:

```
github.com/miekg/dns
---
BenchmarkMsgLen	10000000	2371 ns/op	591 B/op	12 allocs/op

github.com/millerkil/dns branch:opt-compress-help
---
BenchmarkMsgLen	20000000	1208 ns/op	294 B/op	3 allocs/op
```