tree: feb8ad2fdfc1d1638e16f76ddbe8eebf0902b7f7 [path history] [tgz]
  1. datasets/
  2. benchmark_js.dart
  3. benchmark_vm.dart
  4. benchmarks.proto
  5. common.dart
  6. compile-js.sh
  7. compile-protos.sh
  8. d8.dart
  9. README.md
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 produces temp folder with output of protoc.

Running benchmarks on the VM

In benchmarks/ directory:

$ dart benchmark_vm.dart

Running benchmarks via JavaScript (D8)

In benchmarks/ directory:

$ ./compile-js.sh
$ d8 $DART_SDK/lib/_internal/js_runtime/lib/preambles/d8.js temp/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 benchmarks/ directory.