tent/hawk-go — pull request #5 by danieltmiles (2014-08-26 23:22:21+00:00)
Title: faster header parse

I really appreciate your hawk code, we're making good use of it here. Such good use, in fact, that when we profiled, we discovered that the regular expression matcher you're using to pull out all the elements of the hawk header was taking up more CPU cycles than almost anything else.

I propose this change to speed things up by quite a lot, as you'll notice in the benchmarking tests I've added:
$ go test --bench Benchmark.*
OK: 8 passed
PASS
BenchmarkRegexParser 50000 61960 ns/op
BenchmarkSplitterParser 200000 8450 ns/op
ok _/home/dmiles/hawk-go 5.504s