chaokunyang opened a new pull request, #2963: URL: https://github.com/apache/fory/pull/2963
## Why? The previouse benchmark is not fair: - Protobuf encode negative varint use 5 bytes, but fory may only use one bytes. And for small varint, fory has zigzag cost. this is not a fair compare - When serialize Sample, Fory allocate a vector every time, but protobuf serialize to a buffer instead. ## What does this PR do? - Make NumericStruct contains int32 of all kinds size, and positive and negative - Make fory serialize to a buffer to for sample ## Related issues <!-- Is there any related issue? If this PR closes them you say say fix/closes: - #xxxx0 - #xxxx1 - Fixes #xxxx2 --> ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark | Datatype | Operation | Fory (ns) | Protobuf (ns) | Faster | |----------|-----------|-----------|---------------|--------| | Sample | Serialize | 345.6 | 316.4 | Protobuf (1.1x) | | Sample | Deserialize | 1376.4 | 1374.6 | Protobuf (1.0x) | | Struct | Serialize | 129.4 | 157.0 | Fory (1.2x) | | Struct | Deserialize | 207.5 | 154.4 | Protobuf (1.3x) | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
