Use `setRange` when copying output chunks to the final buffer in `CodedBufferWriter` (#887)

Similar to #885, this optimizes some more buffer copying to `memcpy`.

Results from the same benchmark in #885:

|                              | Before     | After      | Diff                |
|------------------------------|------------|------------|---------------------|
| AOT                          | 114,713 us | 109,838 us | - 4,875 us, -4.2%   |
| JIT                          |  91,960 us |  92,887 us | +   927 us, +1.0%   |
| dart2js -O4                  | 259,125 us | 257,000 us | - 2,125 us, -0.8%   |
| dart2wasm --omit-type-checks | 196,909 us | 182,333 us | -14,576 us, -7.4%   |

AOT and JIT tested on x64.
1 file changed
tree: 85fd3c11c25db7977c4743e3d8eb29bd4580b684
  1. .github/
  2. api_benchmark/
  3. benchmarks/
  4. protobuf/
  5. protoc_plugin/
  6. tool/
  7. .gitignore
  8. analysis_options.yaml
  9. AUTHORS
  10. LICENSE
  11. mono_repo.yaml
  12. README.md
README.md

CI status

Protobuf support for Dart

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.

PackageDescriptionPublished Version
protobufA support library for the generated codepub package
protoc_pluginA Dart back-end for the protoc compilerpub package
api_benchmarkBenchmarking for various API calls
query_benchmarkBenchmark for encoding and decoding of a “real-world” protobuf

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.