Printing to ByteBuffer (bytes) - #11
Merged
Merged
Conversation
vkostyukov
force-pushed
the
vk/print-bytes
branch
from
January 9, 2017 15:21
60018c9 to
b9f2e65
Compare
Member
|
Thanks! I'm on the road for the next couple of hours but should be able to get these merged and 0.7.0-M2 published from the airport after that. |
vkostyukov
force-pushed
the
vk/print-bytes
branch
from
January 9, 2017 15:34
b9f2e65 to
5ab0d73
Compare
Current coverage is 87.25% (diff: 100%)@@ master #11 diff @@
==========================================
Files 11 11
Lines 96 102 +6
Methods 87 93 +6
Messages 0 0
Branches 5 5
==========================================
+ Hits 83 89 +6
Misses 13 13
Partials 0 0
|
Contributor
Author
|
Thanks @travisbrown! I think it would be also nice to update README (w.r.t. benchmark results) at some point (when Circe's printing to bytes is also available). |
Member
|
One quibble: what do you think about |
Contributor
Author
|
@travisbrown Agreed. Let me update this. |
vkostyukov
force-pushed
the
vk/print-bytes
branch
from
January 10, 2017 03:40
5ab0d73 to
56852cb
Compare
Member
|
Great, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As discussed in circe/circe#536 and finagle/finch#676 this PR introduces
jacksonPrintBytesthat prints directly intoByteBuffer.I run some benchmarks and the results are quite surprising. The throughput is never better when printing to bytes, but the allocation rate is significantly lower (2x for case classes). Not sure I can reasonably explain neither why allocations are nearly the same when printing int arrays nor why throughput isn't improved. Although, I think it's a reasonable first step in binary printing.