commit | 3ea789fe97a8e569aa5001631d09436a6ab8e685 | [log] [tgz] |
---|---|---|
author | Ömer Sinan Ağacan <omersa@google.com> | Thu Aug 25 12:25:04 2022 +0200 |
committer | GitHub <noreply@github.com> | Thu Aug 25 12:25:04 2022 +0200 |
tree | 2e9e24f3eaeebe6b1af67e517c529094c82ebc80 | |
parent | 78e763cab03cd8ac7b56ddfff66c71b113f820df [diff] |
Avoid redundant shallow copy when getting read-only map fields (#741) `_FieldSet._$getMap` unnecessarily shallow-copies the map field when the message is read-only. If a message is read-only then all of its fields are read-only, so the map fields are read-only. We don't need to copy them. Copying map fields on every access can be expensive depending on the map size, so this will potentially be a significant performance win. (Also, if we had to copy, we would have to deep-copy, rather than shallow-copy, so the code would be buggy if we needed to copy the field) Also fix `_isReadonly` field initialization in `PbMap.unmodifiable`. We do not use `PbMap.unmodifiable` and we don't have any users of it, but I think that method will be useful when fixing #705, so I'm not removing it for now.
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 |