Improve performace of repeated packed fixedSize fields#19667
Closed
YarinOmesi wants to merge 7 commits intoprotocolbuffers:mainfrom
Closed
Improve performace of repeated packed fixedSize fields#19667YarinOmesi wants to merge 7 commits intoprotocolbuffers:mainfrom
YarinOmesi wants to merge 7 commits intoprotocolbuffers:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
f30160d to
8f87b3d
Compare
2823100 to
e5c3514
Compare
Contributor
|
@YarinOmesi - can you rebase this PR to see if that clears up the test failures? |
5fd703d to
7eda30c
Compare
Contributor
|
Can you take a look at the failing C# conformance test? |
Contributor
Author
There was a problem with reading bools with my approch because of .net marshaling stuff, so i added validation that comapre .net size and codec.FixedSize |
JasonLunn
approved these changes
Feb 8, 2025
fgarciacorona
pushed a commit
to fgarciacorona/protobuf
that referenced
this pull request
Mar 5, 2025
…rs#19667) ## Changes Improve performance of packed RepeatedField that has fixed size, by coping `LEN` bytes from serialzied buffer to RepeatedField array (like c memcpy). ## Relevant Information As the docs [here](https://protobuf.dev/programming-guides/encoding/#cheat-sheet) notes, fixed size value is `memcpy of the equivalent C types (u?int64_t, double)` You can see benchmark code and results [here](https://github.com/YarinOmesi/protobuf/blob/feature-with-benchmark/csharp/src/Benchmark) ## Summarized result: | Method | Job | Size | Mean | Ratio | Allocated | |----------------------|------------------------------|--------|-------------:|---------:|----------:| | Parse_RepeatedFloats | 3.29.0 | 100000 | 416,582.7 ns | baseline | 400297 B | | Parse_RepeatedFloats | improved-fixed-size-repeated | 100000 | 134,671.7 ns | -68% | 400776 B | | Write_RepeatedFloats | 3.29.0 | 100000 | 340.549 us | baseline | 391.57 KB | | Write_RepeatedFloats | improved-fixed-size-repeated | 100000 | 106.577 us | -69% | 391.5 KB | --- I am pretty new to this repo to tell me what to you think about this. Closes protocolbuffers#19667 COPYBARA_INTEGRATE_REVIEW=protocolbuffers#19667 from YarinOmesi:improve-performance-repeated-packed-fixed-field de11524 PiperOrigin-RevId: 729380114
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.
Changes
Improve performance of packed RepeatedField that has fixed size, by coping
LENbytes from serialzied buffer to RepeatedField array (like c memcpy).Relevant Information
As the docs here notes, fixed size value is
memcpy of the equivalent C types (u?int64_t, double)You can see benchmark code and results here
Summarized result:
I am pretty new to this repo to tell me what to you think about this.