commit | ef0ab7df985a4b00f3a6850fb160a214ebc0683e | [log] [tgz] |
---|---|---|
author | Sebastian <ignatz@users.noreply.github.com> | Fri Feb 23 09:23:58 2024 +0100 |
committer | GitHub <noreply@github.com> | Fri Feb 23 09:23:58 2024 +0100 |
tree | 53a48656ec83b40e3b0be5426e13fd84c889bd45 | |
parent | f085bfdc4e746cd5e189da3dc9223031cf958e02 [diff] |
Optimize repeated field decoding (#911) Avoid allocating tear-off closures when decoding repeated but non-packed fields. Also refactors `BuilderInfo._decodeEnum`. # Benchmarks `repeated_int64`, `repeated_string`, and `repeated_enum` are the new benchmarks added with this PR. `fromBuffer` is an internal benchmark that decodes a large buffer. `fromBufferUnmodifiableInput` is the same as `fromBuffer`, but the input `Uint8List` is made unmodifiable. ## AOT | | Before | After | Diff | |-----------------------------|-----------|-----------|--------------------| | repeated_int64 | 84,549 us | 61,820 us | -22,729 us, -25.8% | | repeated_string | 67,183 us | 67,984 us | +801 us, +1.19% | | repeated_enum | 52,335 us | 44,772 us | -7,563 us, -14.4% | | fromBuffer | 25,661 us | 25,299 us | -362 us, -1.4% | | fromBufferUnmodifiableInput | 26,135 us | 25,689 us | -446 us, -1.7% | ## JS | | Before | After | Diff | |-----------------------------|------------|------------|--------------------| | repeated_int64 | 112,050 us | 109,850 us | -2,200 us, -1.9% | | repeated_string | 123,050 us | 126,650 us | +3,600 us, +2.9% | | repeated_enum | 43,920 us | 39,400 us | -4,520 us, -10.2% | | fromBuffer | 211,888 us | 168,250 us | -43,638 us, -20.5% | | fromBufferUnmodifiableInput | 227,444 us | 185,454 us | -41,990 us, -18.4% | --------- Co-authored-by: Ömer Sinan Ağacan <omersa@google.com>
Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.
This repository is home to packages related to protobuf for Dart.
Package | Description | Published Version |
---|---|---|
protobuf | A support library for the generated code | |
protoc_plugin | A Dart back-end for the protoc compiler | |
api_benchmark | Benchmarking for various API calls | |
query_benchmark | Benchmark for encoding and decoding of a “real-world” protobuf |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.