tree: 9433403130f335174213d62d1d4bda1bea2a2be6 [path history] [tgz]
  1. bin/
  2. datasets/
  3. lib/
  4. .gitignore
  5. benchmarks.proto
  6. compile_js.sh
  7. compile_protos.sh
  8. d8.dart
  9. pubspec.yaml
  10. README.md
  11. run_protoc_plugin.sh
protobuf_benchmarks/README.md

Protobuf Benchmarks

This directory contains protobuf benchmarks adapted from original protobuf library.

These benchmarks cover parsing and serializing protobufs both to binary and JSON formats, and hash code generation for messages.

Prerequisites

Before running benchmarks you first need to compile all involved protos, which requires installing protoc and protoc_plugin.

$ ./compile_protos.sh

This compiles test protos to Dart.

Running benchmarks on the VM

$ dart bin/benchmark_vm.dart

Running benchmarks via JavaScript (D8)

$ ./compile_js.sh
$ d8 $DART_SDK/lib/_internal/js_runtime/lib/preambles/d8.js bin/benchmark.js

Note: if you are seeing a “Error reading file” error while running the JS benchmarks it means that you are in the wrong directory. Run the d8 command shown above in protobuf_benchmarks/ directory.