go-graphite / carbonzipper

proxy to transparently merge graphite carbon backends
Other
103 stars 29 forks source link

JSON input support #5

Closed grobian closed 10 years ago

grobian commented 10 years ago

carbonserver has a mode to produce json data instead of pickles. Since json is more efficient (and clean) for Go to produce, it would be nice if zipper could read json instead of pickle, to probably optimise the interaction between the two a bit.

dgryski commented 10 years ago

I did some benchmarks with some actual graphite data. Turns out our pickle implementation isn't actually that bad -- probably because it's a binary protocol and we don't have the overhead of actually parsing strings.

BenchmarkPickle    10000        221425 ns/op
BenchmarkJSONStruct     2000        776329 ns/op
BenchmarkProtobuf      50000         58773 ns/op

If we're going to switch serialization formats for carbonzipper+carbonserver, I think I'd prefer to move to protobuf.

dgryski commented 10 years ago

I have now pushed protobuf support for carbonzipper and carbonserver in 3201798c2f01ee4f77d971cf9dab1b0804615fc5