Skip to content

Conversation

@nussjustin
Copy link
Contributor

This reduces allocations when writing multiple quoted
strings or byte slices, by reusing bytes.Buffers, giving
a nice little speed up.

name            old time/op    new time/op    delta
EncodeKeyval-8     635ns ± 2%     593ns ± 0%   -6.52%  (p=0.008 n=5+5)

name            old alloc/op   new alloc/op   delta
EncodeKeyval-8      176B ± 0%       64B ± 0%  -63.64%  (p=0.008 n=5+5)

name            old allocs/op  new allocs/op  delta
EncodeKeyval-8      5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.008 n=5+5)

This reduces allocations when writing multiple quoted
strings or byte slices, by reusing bytes.Buffers, giving
a nice little speed up.

name            old time/op    new time/op    delta
EncodeKeyval-8     635ns ± 2%     593ns ± 0%   -6.52%  (p=0.008 n=5+5)

name            old alloc/op   new alloc/op   delta
EncodeKeyval-8      176B ± 0%       64B ± 0%  -63.64%  (p=0.008 n=5+5)

name            old allocs/op  new allocs/op  delta
EncodeKeyval-8      5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.008 n=5+5)
@coveralls
Copy link

coveralls commented Jun 1, 2016

Coverage Status

Coverage increased (+0.5%) to 81.547% when pulling 389ef9a on nuss-justin:buffer-pool into 538518f on go-logfmt:master.

@ChrisHines
Copy link
Member

Thanks for the contribution. This code is not compatible with Go 1.2, which caused the test failure. Please remove Go 1.2 from the .travis.yml file and update this PR then it should be good to merge.

@nussjustin
Copy link
Contributor Author

Done, Travis is running

@ChrisHines ChrisHines merged commit d432719 into go-logfmt:master Jun 1, 2016
@nussjustin nussjustin deleted the buffer-pool branch June 1, 2016 13:10
@coveralls
Copy link

coveralls commented Jun 1, 2016

Coverage Status

Coverage increased (+0.5%) to 81.547% when pulling d32e7db on nuss-justin:buffer-pool into 538518f on go-logfmt:master.

@coveralls
Copy link

coveralls commented Jun 1, 2016

Coverage Status

Coverage increased (+0.5%) to 81.547% when pulling 8e11237 on nuss-justin:buffer-pool into 538518f on go-logfmt:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants