Sereal/Sereal — pull request #62 by ikruglov (2014-07-16 17:59:07+00:00)
Title: optimize Go's implementation of encoder

With this set of commits the performance of Go encoder's implementation was improved by 2.5-4x.

results of old code:
sereal-go $ go run psrl.go -folder data/ > data_go.srl

The call took 3.001318514s to run.

performance with ExpectedSize hint:
sereal-go $ go run psrl.go -folder data/ -expsize 52428800 > data_go.srl

The call took 708.295852ms to run.

I've benchmarked the code with ad-hoc script:
https://github.com/ikruglov/junk/blob/master/sereal-go/psrl.go
(be carefull, it dumps binary data to STDOUT)

Please refer to commit's comments for more details about what was done.