This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Conversation
This file contains 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
Codecov Report
@@ Coverage Diff @@
## main #709 +/- ##
==========================================
+ Coverage 70.16% 70.44% +0.28%
==========================================
Files 309 310 +1
Lines 16800 16759 -41
==========================================
+ Hits 11787 11806 +19
+ Misses 5013 4953 -60
Continue to review full report at Codecov.
|
jorgecarleitao
force-pushed
the
json_write
branch
from
December 24, 2021 18:40
380c73f
to
5ecd050
Compare
jorgecarleitao
force-pushed
the
json_write
branch
from
December 24, 2021 18:46
5ecd050
to
fa6886e
Compare
Performance improvement is 5-10x for the primitive/utf8 types and likely much more for nested types, since the number of allocations was scaling with Heading out for today. Happy festivities everyone!
|
jorgecarleitao
changed the title
Refactored JSON writing
Refactored JSON writing (5-10x)
Dec 24, 2021
jorgecarleitao
added
backwards-incompatible
and removed
enhancement
An improvement to an existing feature
labels
Dec 25, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR refactored the writing to JSON:
O(N)
toO(1)
by bypassing theserde_json::Value
and use a design based on streaming-iteratorasync
and parallel serializationThis change is backward incompatible - the existing design to write to json was completely replaced by a new design based on IO- / CPU- bounded separatation to enable parallelism,
async
, and stream writing, so any code relying on the old API needs a full migration.Benchmarks (see below) show 5-10x speedup and do not require all data to be available, which imo is sufficient grounds for this backward incompatible change