bitly / statsdaemon

an implementation of Etsy's statsd in Go
The Unlicense
570 stars 131 forks source link

Parse message remove regexp #36

Closed Zariel closed 9 years ago

Zariel commented 9 years ago

Remove the use of regexp to parse incoming message lines, using bytes functions instead.

benchmark                   old ns/op     new ns/op     delta
BenchmarkParseMessage-8     2642          1256          -52.46%

benchmark                   old allocs     new allocs     delta
BenchmarkParseMessage-8     7              6              -14.29%

benchmark                   old bytes     new bytes     delta
BenchmarkParseMessage-8     397           179           -54.91%
mreiferson commented 9 years ago

I like it :+1:

jehiah commented 9 years ago

:smoking: fast.