README.md (protobuf-all-3.20.1) | : | README.md (protobuf-all-3.21.0) | ||
---|---|---|---|---|
# Protocol Buffers Benchmarks | # Protocol Buffers Benchmarks | |||
This directory contains benchmarking schemas and data sets that you | This directory contains benchmarking schemas and data sets that you | |||
can use to test a variety of performance scenarios against your | can use to test a variety of performance scenarios against your | |||
protobuf language runtime. If you are looking for performance | protobuf language runtime. If you are looking for performance | |||
numbers of officially supported languages, see [Protobuf Performance]( | numbers of officially supported languages, see [Protobuf Performance]( | |||
https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md). | https://github.com/protocolbuffers/protobuf/blob/main/docs/performance.md). | |||
## Prerequisite | ## Prerequisite | |||
First, you need to follow the instruction in the root directory's README to | First, you need to follow the instruction in the root directory's README to | |||
build your language's protobuf, then: | build your language's protobuf, then: | |||
### CPP | ### CPP | |||
You need to install [cmake](https://cmake.org/) before building the benchmark. | You need to install [cmake](https://cmake.org/) before building the benchmark. | |||
We are using [google/benchmark](https://github.com/google/benchmark) as the | We are using [google/benchmark](https://github.com/google/benchmark) as the | |||
skipping to change at line 64 | skipping to change at line 64 | |||
``` | ``` | |||
The first command installs `protoc-gen-go` into the `bin` directory in your loca l `GOPATH`. | The first command installs `protoc-gen-go` into the `bin` directory in your loca l `GOPATH`. | |||
The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later. | The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later. | |||
### PHP | ### PHP | |||
PHP benchmark's requirement is the same as PHP protobuf's requirements. The benc hmark will automatically | PHP benchmark's requirement is the same as PHP protobuf's requirements. The benc hmark will automatically | |||
include PHP protobuf's src and build the c extension if required. | include PHP protobuf's src and build the c extension if required. | |||
### Node.js | ### Node.js | |||
Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm]( https://www.npmjs.com/) package manager installed. This benchmark is using the [ benchmark](https://www.npmjs.com/package/benchmark) framework to test, which nee dn't to manually install. And another prerequisite is [protobuf js](https://gith ub.com/protocolbuffers/protobuf/tree/master/js), which needn't to manually insta ll either | Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm]( https://www.npmjs.com/) package manager installed. This benchmark is using the [ benchmark](https://www.npmjs.com/package/benchmark) framework to test, which nee dn't to manually install. And another prerequisite is [protobuf js](https://gith ub.com/protocolbuffers/protobuf/tree/main/js), which needn't to manually install either | |||
### C# | ### C# | |||
The C# benchmark code is built as part of the main Google.Protobuf | The C# benchmark code is built as part of the main Google.Protobuf | |||
solution. It requires the .NET Core SDK, and depends on | solution. It requires the .NET Core SDK, and depends on | |||
[BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet), which | [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet), which | |||
will be downloaded automatically. | will be downloaded automatically. | |||
### Big data | ||||
There's some optional big testing data which is not included in the directory | ||||
initially, you need to run the following command to download the testing data: | ||||
``` | ||||
$ ./download_data.sh | ||||
``` | ||||
After doing this the big data file will automatically generated in the | ||||
benchmark directory. | ||||
## Run instructions | ## Run instructions | |||
To run all the benchmark dataset: | To run all the benchmark dataset: | |||
### Java: | ### Java: | |||
First build the Java binary in the usual way with Maven: | First build the Java binary in the usual way with Maven: | |||
``` | ``` | |||
$ cd java | $ cd java | |||
End of changes. 3 change blocks. | ||||
14 lines changed or deleted | 2 lines changed or added |