-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve performace of repeated packed fixedSize fields (#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 #19667 COPYBARA_INTEGRATE_REVIEW=#19667 from YarinOmesi:improve-performance-repeated-packed-fixed-field de11524 PiperOrigin-RevId: 729380114
- Loading branch information
1 parent
b666009
commit 85507b9
Showing
2 changed files
with
76 additions
and
11 deletions.
There are no files selected for viewing
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
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