diff options
author | Yilun Chong <chongyilun250@sina.com> | 2018-01-05 15:20:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-05 15:20:10 -0800 |
commit | 4adc5a48c07a13489670384ab584806534024a58 (patch) | |
tree | 2354f91f0bb53dd30a2e3e756e7bc32013e55840 /benchmarks/README.md | |
parent | a3868af12be724f808faa21a29e7b4931e30bed1 (diff) | |
parent | 2fc69b1561e1feaa1cbc56d1617f949d13352b97 (diff) | |
download | protobuf-4adc5a48c07a13489670384ab584806534024a58.tar.gz protobuf-4adc5a48c07a13489670384ab584806534024a58.tar.bz2 protobuf-4adc5a48c07a13489670384ab584806534024a58.zip |
Merge pull request #4065 from BSBandme/python_benchmark_real
Add python benchmark
Diffstat (limited to 'benchmarks/README.md')
-rw-r--r-- | benchmarks/README.md | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/benchmarks/README.md b/benchmarks/README.md index 09c06907..71104d69 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -17,12 +17,25 @@ 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. -### JAVA +### 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 [google/caliper](https://github.com/google/caliper) as benchmark tool, which can be automaticly included by maven. +### Python +We're using python C++ API for testing the generated +CPP proto version of python protobuf, which is also a prerequisite for Python +protobuf cpp implementation. You need to install the correct version of Python +C++ extension package before run generated CPP proto version of Python +protobuf's benchmark. e.g. under Ubuntu, you need to + +``` +$ sudo apt-get install python-dev +$ sudo apt-get install python3-dev +``` +And you also need to make sure `pkg-config` is installed. + ### Big data There's some optional big testing data which is not included in the directory initially, you need to @@ -38,34 +51,80 @@ After doing this the big data file will automaticly generated in the benchmark d To run all the benchmark dataset: -For java: +### Java: ``` $ make java ``` -For cpp: +### CPP: ``` $ make cpp ``` +### Python: + +We have three versions of python protobuf implementation: pure python, cpp reflection and +cpp generated code. To run these version benchmark, you need to: + +#### Pure Python: + +``` +$ make python-pure-python +``` + +#### CPP reflection: + +``` +$ make python-cpp-reflection +``` + +#### CPP generated code: + +``` +$ make python-cpp-generated-code +``` + To run a specific dataset: -For java: +### Java: ``` $ make java-benchmark $ ./java-benchmark $(specific generated dataset file name) [-- $(caliper option)] ``` -For cpp: +### CPP: ``` $ make cpp-benchmark $ ./cpp-benchmark $(specific generated dataset file name) ``` +### Python: + +#### Pure Python: + +``` +$ make python-pure-python-benchmark +$ ./python-pure-python-benchmark $(specific generated dataset file name) +``` + +#### CPP reflection: + +``` +$ make python-cpp-reflection-benchmark +$ ./python-cpp-reflection-benchmark $(specific generated dataset file name) +``` + +#### CPP generated code: + +``` +$ make python-cpp-generated-code-benchmark +$ ./python-cpp-generated-code-benchmark $(specific generated dataset file name) +``` + ## Benchmark datasets Each data set is in the format of benchmarks.proto: |