sendgrid/go-statsdclient — pull request #2 by ninetwentyfour (2014-04-20 15:46:19+00:00)
Title: replace sprintfs with +

As discussed here http://stackoverflow.com/questions/19101419/go-golang-formatfloat-convert-float-number-to-string#comment28244661_19101700 and http://grokbase.com/t/gg/golang-nuts/141v598t2c/go-nuts-string-concatenation-performance using + to concatenate strings is faster than using sprintf.

Local benchmarks show the same thing

BenchmarkSprintf 5000000 353 ns/op
BenchmarkAdd 50000000 61.9 ns/op
BenchmarkSprintfWithInt 5000000 339 ns/op
BenchmarkAddWithInt 20000000 120 ns/op
BenchmarkSprintfWithfloat64 2000000 823 ns/op
BenchmarkAddWithfloat64 5000000 381 ns/op