pquerna/ffjson — pull request #3 by pquerna (2014-03-29 20:03:16+00:00)
Title: Add a .MarshalJSONBuf interface to reduce bytes.Buffer allocations

Adds a new interface, `MarshalJSONBuf` which takes a `bytes.Buffer` as a parameter, instead of returning `[]bytes`.

This is about ~16% faster on my laptop for the `goser` Log structure.

```
BenchmarkFFMarshalJSON	200000	10164 ns/op	60.60 MB/s	4227 B/op	46 allocs/op
BenchmarkFFMarshalJSONBuf	200000	8697 ns/op	70.83 MB/s	1959 B/op	42 allocs/op
```