-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Additional UTF8Json overloads, consolidate how we tell it to write/serialize. #4313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
russcam
approved these changes
Jan 10, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Left one minor nitpick
The error and std dev generally look much better after too! 🎉
src/Elasticsearch.Net/Serialization/DiagnosticsSerializerProxy.cs
Outdated
Show resolved
Hide resolved
New types * `ReadOnlyMemory`, only available in `netstandard2.1` allows you to post `ReadOnlyMemory<byte>` * `StreamHandler` allows you to inject a stream handler and write to the request streams the best way you see fit yourself Performance * `PostData.String` now reuses bytes * `PostData.MultiJson(string[]) uses way less allocations
Expose reusable stream handling on `PostData` Add tests for new types so that they behave and write as expected
Either memory stream or to serialize on the writer. This consolidates and funnels places that need to write bytes/streams/objects directly (cherry picked from commit de62914)
(cherry picked from commit fc289b1)
…atter (cherry picked from commit ffc4e46)
(cherry picked from commit f365b30)
(cherry picked from commit b07e0a8)
1e7ff71
to
e08f2ac
Compare
Mpdreamz
added a commit
that referenced
this pull request
Jan 10, 2020
…rialize. (#4313) * Several improvements to PostData New types * `ReadOnlyMemory`, only available in `netstandard2.1` allows you to post `ReadOnlyMemory<byte>` * `StreamHandler` allows you to inject a stream handler and write to the request streams the best way you see fit yourself Performance * `PostData.String` now reuses bytes * `PostData.MultiJson(string[]) uses way less allocations * Adds more write overloads to Utf8Json Either memory stream or to serialize on the writer. This consolidates and funnels places that need to write bytes/streams/objects directly (cherry picked from commit de62914) * add missing hunk after git add -p session (cherry picked from commit fc289b1) * add comment explaining the check for possible fast path in sourceformatter (cherry picked from commit ffc4e46) * Move fastpath check into method and use it for Deserialize too (cherry picked from commit f365b30) * update formatters to use a better check for fast path (cherry picked from commit b07e0a8) * Move StreamHandler in to its own type. Expose reusable stream handling on `PostData` Add tests for new types so that they behave and write as expected * Zap IInternalSerializerWithFormatter * Make sure WriteRaw for memory streams assumes a memorycopy * Make sure final newline is written again for bulk requests * Address PR feedback * reoorder variable assignments (cherry picked from commit fadef66)
Mpdreamz
added a commit
that referenced
this pull request
Jan 10, 2020
* Several improvements to PostData (#4312) * Several improvements to PostData New types * `ReadOnlyMemory`, only available in `netstandard2.1` allows you to post `ReadOnlyMemory<byte>` * `StreamHandler` allows you to inject a stream handler and write to the request streams the best way you see fit yourself Performance * `PostData.String` now reuses bytes * `PostData.MultiJson(string[]) uses way less allocations * Move StreamHandler in to its own type. Expose reusable stream handling on `PostData` Add tests for new types so that they behave and write as expected * update post-data docs * Refactor SerializableData and reuse methods from PostData (cherry picked from commit af93854) * Additional UTF8Json overloads, consolidate how we tell it to write/serialize. (#4313) * Several improvements to PostData New types * `ReadOnlyMemory`, only available in `netstandard2.1` allows you to post `ReadOnlyMemory<byte>` * `StreamHandler` allows you to inject a stream handler and write to the request streams the best way you see fit yourself Performance * `PostData.String` now reuses bytes * `PostData.MultiJson(string[]) uses way less allocations * Adds more write overloads to Utf8Json Either memory stream or to serialize on the writer. This consolidates and funnels places that need to write bytes/streams/objects directly (cherry picked from commit de62914) * add missing hunk after git add -p session (cherry picked from commit fc289b1) * add comment explaining the check for possible fast path in sourceformatter (cherry picked from commit ffc4e46) * Move fastpath check into method and use it for Deserialize too (cherry picked from commit f365b30) * update formatters to use a better check for fast path (cherry picked from commit b07e0a8) * Move StreamHandler in to its own type. Expose reusable stream handling on `PostData` Add tests for new types so that they behave and write as expected * Zap IInternalSerializerWithFormatter * Make sure WriteRaw for memory streams assumes a memorycopy * Make sure final newline is written again for bulk requests * Address PR feedback * reoorder variable assignments (cherry picked from commit fadef66)
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.
Continuation of #4312
Pulling in the bits initially opened here: #4209
Either memory stream or to serialize on the writer.
This consolidates and funnels places that need to write bytes/streams/objects directly.
Isolated from #4172 and #4191 which both grew to be too big to review
Prior:
After: