You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #676 (and implemented in Circe 0.7.0-M2), encoding should be performed in terms of bytes to avoid extra to-string conversion hence reduce allocations.
New benchmark confirms that printing to bytes directly cuts allocations in half and improves the throughput by ~15-20%.
@travisbrown Out of curiosity, any idea why printing int arrays/lists could be slower when targeting byte-buffers in circe-core? I'm wondering if there is anything we could do on a Circe side to improve it. I'm happy to file a ticket if you think it deserves an attention.
@vkostyukov I just put together some simple benchmarks to try to track this down, but they're not very helpful. I don't really understand how you could see so much of a difference in that one case specifically, since they're both using the same Appendable interface.
@travisbrown I think the benchmark results are just volatile enough (at least on my machine) to not capture the difference precisely. Let me try to make it more stable and see if we can get those numbers aligned. I think by reducing the size of data set (reducing allocations) we should get fewer GC pauses and more predictable results.
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
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 #676 (and implemented in Circe 0.7.0-M2), encoding should be performed in terms of bytes to avoid extra to-string conversion hence reduce allocations.
New benchmark confirms that printing to bytes directly cuts allocations in half and improves the throughput by ~15-20%.