Fixed leaky buffer when streaming.#243
Merged
svobol13 merged 8 commits intojson-iterator:masterjson-iterator/java:masterfrom Jan 20, 2022
Merged
Fixed leaky buffer when streaming.#243svobol13 merged 8 commits intojson-iterator:masterjson-iterator/java:masterfrom
svobol13 merged 8 commits intojson-iterator:masterjson-iterator/java:masterfrom
Conversation
…city and while keeping exactly same semantics.
…ned in previous commit.
… size. This fixes bug json-iterator#241 and json-iterator#124 issues.
Codecov Report
@@ Coverage Diff @@
## master #243 +/- ##
=========================================
+ Coverage 68.46% 68.5% +0.04%
=========================================
Files 107 107
Lines 7335 7338 +3
Branches 1388 1389 +1
=========================================
+ Hits 5022 5027 +5
+ Misses 1867 1866 -1
+ Partials 446 445 -1
Continue to review full report at Codecov.
|
This was referenced Jan 22, 2022
This was
linked to
issues
Jan 23, 2022
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.
Reworked a way how internal buffer size increases when streaming. The new way changes both
whenandhowit increases size.When: Whenever current buffer size is fully utilized AND autoresizing is enabled.
How: It increases buffer size with configured absolute number of bytes instead of doubling the capacity.
New API: Added new factory method
parse(InputStream in, int bufSize, int autoExpandBufferStep)that creates Iterator with posibility to control how autoresizing works. Set 0 to disable, set 5 to increase buffer size of 5 bytes everytime we hit end.Backward compatibility: Factory
parse(InputStream in, int bufSize)was changed with respect to previous setting. First increase of buffer size is exactly same as it was in pass though any subsequent increase is same size as first one in contrast to previous behaviour (it was growing exponentially).