aboutsummaryrefslogtreecommitdiffhomepage
path: root/benchmarks/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/README.md')
-rw-r--r--benchmarks/README.md56
1 files changed, 49 insertions, 7 deletions
diff --git a/benchmarks/README.md b/benchmarks/README.md
index 459c7b9d..ae5c7ddd 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -3,7 +3,9 @@
This directory contains benchmarking schemas and data sets that you
can use to test a variety of performance scenarios against your
-protobuf language runtime.
+protobuf language runtime. If you are looking for performance
+numbers of officially support languages, see [here](
+https://github.com/google/protobuf/blob/master/docs/performance.md)
## Prerequisite
@@ -17,6 +19,11 @@ We are using [google/benchmark](https://github.com/google/benchmark) as the
benchmark tool for testing cpp. This will be automaticly made during build the
cpp benchmark.
+The cpp protobuf performance can be improved by linking with [tcmalloc library](
+https://gperftools.github.io/gperftools/tcmalloc.html). For using tcmalloc, you
+need to build [gpertools](https://github.com/gperftools/gperftools) to generate
+libtcmallc.so library.
+
### Java
We're using maven to build the java benchmarks, which is the same as to build
the Java protobuf. There're no other tools need to install. We're using
@@ -36,6 +43,21 @@ $ sudo apt-get install python3-dev
```
And you also need to make sure `pkg-config` is installed.
+### Go
+Go protobufs are maintained at [github.com/golang/protobuf](
+http://github.com/golang/protobuf). If not done already, you need to install the
+toolchain and the Go protoc-gen-go plugin for protoc.
+
+To install protoc-gen-go, run:
+
+```
+$ go get -u github.com/golang/protobuf/protoc-gen-go
+$ export PATH=$PATH:$(go env GOPATH)/bin
+```
+
+The first command installs `protoc-gen-go` into the `bin` directory in your local `GOPATH`.
+The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later.
+
### Big data
There's some optional big testing data which is not included in the directory
@@ -64,6 +86,12 @@ $ make java
$ make cpp
```
+For linking with tcmalloc:
+
+```
+$ env LD_PRELOAD={directory to libtcmalloc.so} make cpp
+```
+
### Python:
We have three versions of python protobuf implementation: pure python, cpp
@@ -87,45 +115,59 @@ $ make python-cpp-reflection
$ make python-cpp-generated-code
```
-To run a specific dataset:
+### Go
+```
+$ make go
+```
+
+To run a specific dataset or run with specific options:
### Java:
```
$ make java-benchmark
-$ ./java-benchmark $(specific generated dataset file name) [-- $(caliper option)]
+$ ./java-benchmark $(specific generated dataset file name) [$(caliper options)]
```
### CPP:
```
$ make cpp-benchmark
-$ ./cpp-benchmark $(specific generated dataset file name)
+$ ./cpp-benchmark $(specific generated dataset file name) [$(benchmark options)]
```
### Python:
+For Python benchmark we have `--json` for outputing the json result
+
#### Pure Python:
```
$ make python-pure-python-benchmark
-$ ./python-pure-python-benchmark $(specific generated dataset file name)
+$ ./python-pure-python-benchmark [--json] $(specific generated dataset file name)
```
#### CPP reflection:
```
$ make python-cpp-reflection-benchmark
-$ ./python-cpp-reflection-benchmark $(specific generated dataset file name)
+$ ./python-cpp-reflection-benchmark [--json] $(specific generated dataset file name)
```
#### CPP generated code:
```
$ make python-cpp-generated-code-benchmark
-$ ./python-cpp-generated-code-benchmark $(specific generated dataset file name)
+$ ./python-cpp-generated-code-benchmark [--json] $(specific generated dataset file name)
```
+### Go:
+```
+$ make go-benchmark
+$ ./go-benchmark $(specific generated dataset file name) [go testing options]
+```
+
+
## Benchmark datasets
Each data set is in the format of benchmarks.proto: