commit | 42436cdbed3fc4f1d4a8e4f027f9ebbc087c8a67 | [log] [tgz] |
---|---|---|
author | Ömer Sinan Ağacan <omersa@google.com> | Thu Oct 26 14:08:31 2023 +0200 |
committer | GitHub <noreply@github.com> | Thu Oct 26 14:08:31 2023 +0200 |
tree | c9c5673f9b944bbd81bc64318c0c5b0e3393b1fc | |
parent | 9a73936e354d64784d632c6999dceac96c8d8146 [diff] |
Keep a `ByteData` around in `CodedBufferReader` to avoid repeated `ByteData` allocs (#890) In Dart, the only way to convert a list of bytes to an `int` or `double` is by using a `ByteData`. Currently `CodedBufferReader` allocates a new `ByteData` for every fixed-size `int` or `float` decoding. With this change we now allocate a `ByteData` once initialization and reuse it. Benchmark results, using the same benchmark reported in #888: | | Before | After | Diff | |------------------------------|------------|------------|---------------------| | AOT | 26,763 us | 25,305 us | - 1,458 us, - 5.4% | | JIT | 24,573 us | 25,521 us | + 948 us, + 3.8% | | dart2js -O4 | 212,000 us | 199,300 us | -12,700 us, - 5.9% | | dart2wasm --omit-type-checks | 89,750 us | 78,958 us | -10,792 us, -12.0% |
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.