mailgun/metrics — pull request #3 by klizhentas (2014-11-08 05:23:08+00:00)
Title: Refactor metrics package to improve performance.

There were two problems with this package affecting performance:

* Excessive usage of fmt.Sprintf that was slowing things down
* Packet sent per every metric, what was generating too many system calls

This refactoring adds option for buffered writes as well as uses bytes.Buffer and avoids system calls.

Here's the micro benchmark:

https://gist.github.com/klizhentas/300e19bbada120db2454

Now it gives 900,000 metrics per second on my laptop.