From 745ef89ebf9408afc229ab6b6c28a16ef8268a8f Mon Sep 17 00:00:00 2001 From: Yilun Chong Date: Thu, 22 Mar 2018 17:08:06 -0700 Subject: Add performance.md and add instruction for linking tcmalloc --- docs/performance.md | 304 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 docs/performance.md (limited to 'docs') diff --git a/docs/performance.md b/docs/performance.md new file mode 100644 index 00000000..6a5316c8 --- /dev/null +++ b/docs/performance.md @@ -0,0 +1,304 @@ +# Protobuf Perforamcne +This benchmark result is tested on workstation with processor of Intel® Xeon® Processor E5-2630 and 32GB RAM + +This table contains 3 languages' results: + +* **C++** - For C++ there're 3 kinds of parsing ways: + * **new** - This is for using new operator for creating message instance. + * **new arena** - This is for using arena for creating new message instance. + * **reuse** - This is for reusing the same message instance for parsing. +* **Java** - For Java there're 3 kinds of parsing/Serialization ways: + * **byte[]** - This is for parsing from a Byte Array. + * **ByteString** - This is for parsing from a + com.google.protobuf.ByteString. + * **InputStream** - This is for parsing from a InputStream +* **Python** - For Pythong there're 3 kinds of python protobuf for testing: + * **C++-genereated-code** - This is for using cpp generated code of the + proto file as dynamic linked library. + * **C++-reflection** - This is for using cpp reflection, which there's no + generated code, but still using cpp protobuf library as dynamic linked + library. + * **pure-Python** - This is for pure Python version, which don't link with + any cpp protobuf library. + +## Parsing performance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
C++C++ with tcmallocjavapython
newnew arenareusenewnew arenareusebyte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto2368.717MB/s261.847MB/s799.403MB/s645.183MB/s441.023MB/s1.122GB/s425.437MB/s425.937MB/s251.018MB/s82.8314MB/s47.6763MB/s3.76299MB/s
google_message1_proto3294.517MB/s229.116MB/s469.982MB/s434.510MB/s394.701MB/s591.931MB/s357.597MB/s378.568MB/s221.676MB/s82.0498MB/s39.9467MB/s3.77751MB/s
google_message2277.242MB/s347.611MB/s793.67MB/s503.721MB/s596.333MB/s922.533MB/s416.778MB/s419.543MB/s367.145MB/s241.46MB/s71.5723MB/s2.73538MB/s
google_message3_1213.478MB/s291.58MB/s543.398MB/s539.704MB/s717.300MB/s927.333MB/s684.241MB/s704.47MB/s648.624MB/s209.036MB/s142.356MB/s15.3324MB/s
google_message3_2672.685MB/s802.767MB/s1.21505GB/s985.790MB/s1.136GB/s1.367GB/s1.54439GB/s1.60603GB/s1.33443GB/s573.835MB/s314.33MB/s15.0169MB/s
google_message3_3207.681MB/s140.591MB/s535.181MB/s369.743MB/s262.301MB/s556.644MB/s279.385MB/s304.853MB/s107.575MB/s32.248MB/s26.1431MB/s2.63541MB/s
google_message3_47.96091GB/s7.10024GB/s9.3013GB/s8.518GB/s8.171GB/s9.917GB/s5.78006GB/s5.85198GB/s4.62609GB/s2.49631GB/s2.35442GB/s802.061MB/s
google_message3_576.0072MB/s51.6769MB/s237.856MB/s178.495MB/s111.751MB/s329.569MB/s121.038MB/s132.866MB/s36.9197MB/s10.3962MB/s8.84659MB/s1.25203MB/s
google_message4331.46MB/s404.862MB/s427.99MB/s589.887MB/s720.367MB/s705.373MB/s606.228MB/s589.13MB/s530.692MB/s305.543MB/s174.834MB/s7.86485MB/s
+ +## Serialization performance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
C++C++ with tcmallocjavapython
byte[]ByteStringInputStreamC++-generated-codeC++-reflectionpure-Python
google_message1_proto21.39698GB/s1.701GB/s1.12915GB/s1.13589GB/s758.609MB/s260.911MB/s58.4815MB/s5.77824MB/s
google_message1_proto3959.305MB/s939.404MB/s1.15372GB/s1.07824GB/s802.337MB/s239.4MB/s33.6336MB/s5.80524MB/s
google_message21.27429GB/s1.402GB/s1.01039GB/s1022.99MB/s798.736MB/s996.755MB/s57.9601MB/s4.09246MB/s
google_message3_11.31916GB/s2.049GB/s991.496MB/s860.332MB/s662.88MB/s1.48625GB/s421.287MB/s18.002MB/s
google_message3_22.15676GB/s2.632GB/s2.14736GB/s2.08136GB/s1.55997GB/s2.39597GB/s326.777MB/s16.0527MB/s
google_message3_3650.456MB/s1.040GB/s593.52MB/s580.667MB/s346.839MB/s123.978MB/s35.893MB/s2.32834MB/s
google_message3_48.70154GB/s9.825GB/s5.88645GB/s5.93946GB/s2.44388GB/s5.9241GB/s4.05837GB/s876.87MB/s
google_message3_5246.33MB/s443.993MB/s283.278MB/s259.167MB/s206.37MB/s37.0285MB/s12.2228MB/s1.1979MB/s
google_message41.56674GB/s2.19601GB/s776.907MB/s770.707MB/s702.931MB/s1.49623GB/s205.116MB/s8.93428MB/s
+ +\* The cpp performance can be improved by using [tcmalloc](https://gperftools.github.io/gperftools/tcmalloc.html), please follow the (instruction)[https://github.com/google/protobuf/blob/master/benchmarks/README.md] to link with tcmalloc to get the faster result. -- cgit v1.2.3