Permalink
Browse files

Sync internal benchmark changes

  • Loading branch information...
BSBandme committed Dec 1, 2017
1 parent a711e3d commit 1c062a65af0fb439167d9cf81ef28c14c3836ace
Showing with 8,652 additions and 460 deletions.
  1. +137 −59 benchmarks/Makefile.am
  2. +189 −73 benchmarks/ProtoBench.java
  3. +32 −9 benchmarks/README.md
  4. +0 −143 benchmarks/benchmark_messages_proto2.proto
  5. +23 −12 benchmarks/cpp_benchmark.cc
  6. +78 −0 benchmarks/datasets/google_message1/benchmark_message1_proto2.proto
  7. 0 ...arks/{benchmark_messages_proto3.proto → datasets/google_message1/benchmark_message1_proto3.proto}
  8. BIN benchmarks/{google_message1.dat → datasets/google_message1/dataset.google_message1_proto2.pb}
  9. BIN benchmarks/datasets/google_message1/dataset.google_message1_proto3.pb
  10. +76 −0 benchmarks/datasets/google_message2/benchmark_message2.proto
  11. BIN benchmarks/{google_message2.dat → datasets/google_message2/dataset.google_message2.pb}
  12. +533 −0 benchmarks/datasets/google_message3/benchmark_message3.proto
  13. +1,279 −0 benchmarks/datasets/google_message3/benchmark_message3_1.proto
  14. +498 −0 benchmarks/datasets/google_message3/benchmark_message3_2.proto
  15. +465 −0 benchmarks/datasets/google_message3/benchmark_message3_3.proto
  16. +490 −0 benchmarks/datasets/google_message3/benchmark_message3_4.proto
  17. +472 −0 benchmarks/datasets/google_message3/benchmark_message3_5.proto
  18. +453 −0 benchmarks/datasets/google_message3/benchmark_message3_6.proto
  19. +55 −0 benchmarks/datasets/google_message3/benchmark_message3_7.proto
  20. +1,899 −0 benchmarks/datasets/google_message3/benchmark_message3_8.proto
  21. +453 −0 benchmarks/datasets/google_message4/benchmark_message4.proto
  22. +473 −0 benchmarks/datasets/google_message4/benchmark_message4_1.proto
  23. +291 −0 benchmarks/datasets/google_message4/benchmark_message4_2.proto
  24. +750 −0 benchmarks/datasets/google_message4/benchmark_message4_3.proto
  25. +5 −0 benchmarks/download_data.sh
  26. +0 −117 benchmarks/generate_datasets.cc
  27. +0 −46 benchmarks/readme.txt
  28. +1 −1 third_party/benchmark
View
@@ -1,65 +1,35 @@
benchmarks_protoc_inputs = \
benchmarks.proto \
benchmark_messages_proto3.proto
benchmarks_protoc_inputs_proto2 = \
benchmark_messages_proto2.proto
benchmarks_protoc_outputs = \
benchmarks.pb.cc \
benchmarks.pb.h \
benchmark_messages_proto3.pb.cc \
benchmark_messages_proto3.pb.h
benchmarks_protoc_outputs_proto2 = \
benchmark_messages_proto2.pb.cc \
benchmark_messages_proto2.pb.h
AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
bin_PROGRAMS = generate-datasets cpp-benchmark
generate_datasets_LDADD = $(top_srcdir)/src/libprotobuf.la
generate_datasets_SOURCES = generate_datasets.cc
generate_datasets_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
nodist_generate_datasets_SOURCES = \
$(benchmarks_protoc_outputs) \
$(benchmarks_protoc_outputs_proto2)
# Explicit deps because BUILT_SOURCES are only done before a "make all/check"
# so a direct "make test_cpp" could fail if parallel enough.
# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
generate_datasets-generate_datasets.$(OBJEXT): benchmarks.pb.h
cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
cpp_benchmark_SOURCES = cpp_benchmark.cc
cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -I$(top_srcdir)/third_party/benchmark/include
nodist_cpp_benchmark_SOURCES = \
$(benchmarks_protoc_outputs) \
$(benchmarks_protoc_outputs_proto2)
$(benchmarks_protoc_outputs): protoc_middleman
$(benchmarks_protoc_outputs_proto2): protoc_middleman2
CLEANFILES = \
$(benchmarks_protoc_outputs) \
$(benchmarks_protoc_outputs_proto2) \
protoc_middleman \
protoc_middleman2 \
dataset.*
MAINTAINERCLEANFILES = \
Makefile.in
benchmarks_protoc_inputs = \
benchmarks.proto \
datasets/google_message1/benchmark_message1_proto3.proto
benchmarks_protoc_inputs_proto2 = \
datasets/google_message1/benchmark_message1_proto2.proto \
datasets/google_message2/benchmark_message2.proto \
datasets/google_message3/benchmark_message3.proto \
datasets/google_message3/benchmark_message3_1.proto \
datasets/google_message3/benchmark_message3_2.proto \
datasets/google_message3/benchmark_message3_3.proto \
datasets/google_message3/benchmark_message3_4.proto \
datasets/google_message3/benchmark_message3_5.proto \
datasets/google_message3/benchmark_message3_6.proto \
datasets/google_message3/benchmark_message3_7.proto \
datasets/google_message3/benchmark_message3_8.proto \
datasets/google_message4/benchmark_message4.proto \
datasets/google_message4/benchmark_message4_1.proto \
datasets/google_message4/benchmark_message4_2.proto \
datasets/google_message4/benchmark_message4_3.proto
MAINTAINERCLEANFILES = \
Makefile.in
if USE_EXTERNAL_PROTOC
protoc_middleman: $(benchmarks_protoc_inputs)
$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs)
$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=./tmp $(benchmarks_protoc_inputs)
touch protoc_middleman
protoc_middleman2: $(benchmarks_protoc_inputs_proto2)
$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs_proto2)
$(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=./tmp $(benchmarks_protoc_inputs_proto2)
touch protoc_middleman2
else
@@ -68,11 +38,119 @@ else
# relative to srcdir, which may not be the same as the current directory when
# building out-of-tree.
protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs)
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs) )
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) )
touch protoc_middleman
protoc_middleman2: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs)
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs_proto2) )
touch protoc_middleman
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2) )
touch protoc_middleman2
endif
all_data = `find . -type f -name "dataset.*.pb"`
############# CPP RULES ##############
benchmarks_protoc_outputs = \
benchmarks.pb.cc \
datasets/google_message1/benchmark_message1_proto3.pb.cc
benchmarks_protoc_outputs_header = \
benchmarks.pb.h \
datasets/google_message1/benchmark_message1_proto3.pb.h
benchmarks_protoc_outputs_proto2_header = \
datasets/google_message1/benchmark_message1_proto2.pb.h \
datasets/google_message2/benchmark_message2.pb.h \
datasets/google_message3/benchmark_message3.pb.h \
datasets/google_message3/benchmark_message3_1.pb.h \
datasets/google_message3/benchmark_message3_2.pb.h \
datasets/google_message3/benchmark_message3_3.pb.h \
datasets/google_message3/benchmark_message3_4.pb.h \
datasets/google_message3/benchmark_message3_5.pb.h \
datasets/google_message3/benchmark_message3_6.pb.h \
datasets/google_message3/benchmark_message3_7.pb.h \
datasets/google_message3/benchmark_message3_8.pb.h \
datasets/google_message4/benchmark_message4.pb.h \
datasets/google_message4/benchmark_message4_1.pb.h \
datasets/google_message4/benchmark_message4_2.pb.h \
datasets/google_message4/benchmark_message4_3.pb.h
benchmarks_protoc_outputs_proto2 = \
datasets/google_message1/benchmark_message1_proto2.pb.cc \
datasets/google_message2/benchmark_message2.pb.cc \
datasets/google_message3/benchmark_message3.pb.cc \
datasets/google_message3/benchmark_message3_1.pb.cc \
datasets/google_message3/benchmark_message3_2.pb.cc \
datasets/google_message3/benchmark_message3_3.pb.cc \
datasets/google_message3/benchmark_message3_4.pb.cc \
datasets/google_message3/benchmark_message3_5.pb.cc \
datasets/google_message3/benchmark_message3_6.pb.cc \
datasets/google_message3/benchmark_message3_7.pb.cc \
datasets/google_message3/benchmark_message3_8.pb.cc \
datasets/google_message4/benchmark_message4.pb.cc \
datasets/google_message4/benchmark_message4_1.pb.cc \
datasets/google_message4/benchmark_message4_2.pb.cc \
datasets/google_message4/benchmark_message4_3.pb.cc
$(benchmarks_protoc_outputs): protoc_middleman
$(benchmarks_protoc_outputs_header): protoc_middleman
$(benchmarks_protoc_outputs_proto2): protoc_middleman2
$(benchmarks_protoc_outputs_proto2_header): protoc_middleman2
AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
bin_PROGRAMS = cpp-benchmark
cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
cpp_benchmark_SOURCES = cpp_benchmark.cc
cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -I$(top_srcdir)/third_party/benchmark/include
# Explicit deps because BUILT_SOURCES are only done before a "make all/check"
# so a direct "make test_cpp" could fail if parallel enough.
# See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header)
nodist_cpp_benchmark_SOURCES = \
$(benchmarks_protoc_outputs) \
$(benchmarks_protoc_outputs_proto2) \
$(benchmarks_protoc_outputs_proto2_header) \
$(benchmarks_protoc_outputs_header)
cpp: protoc_middleman protoc_middleman2 cpp-benchmark
./cpp-benchmark $(all_data)
############ CPP RULES END ############
############# JAVA RULES ##############
javac_middleman: ProtoBench.java protoc_middleman protoc_middleman2
jar=`ls $(top_srcdir)/java/util/target/*.jar` && \
jar1=`ls $(top_srcdir)/java/core/target/*.jar` && \
javac -d tmp -classpath ../java/target/classes:$$jar:$$jar1 ProtoBench.java $(benchmark_java_protoc_outputs_proto2) $(benchmarks_java_protoc_outputs) `find tmp -type f -name "*.java"`
@touch javac_middleman
java-benchmark: javac_middleman
@echo "Writing shortcut script java-benchmark..."
@echo '#! /bin/sh' > java-benchmark
@jar=`ls $(top_srcdir)/java/util/target/*.jar` && \
jar1=`ls $(top_srcdir)/java/core/target/*.jar` && \
echo java -classpath tmp:../java/target/classes:$$jar:$$jar1 com.google.protocolbuffers.ProtoBench '$$@' >> java-benchmark
@chmod +x java-benchmark
java: protoc_middleman protoc_middleman2 java-benchmark
./java-benchmark $(all_data)
############# JAVA RULES END ##############
CLEANFILES = \
$(benchmarks_protoc_outputs) \
$(benchmarks_protoc_outputs_header) \
$(benchmarks_protoc_outputs_proto2) \
$(benchmarks_protoc_outputs_proto2_header) \
protoc_middleman \
protoc_middleman2 \
javac_middleman \
java-benchmark
clean-local:
-rm -rf tmp/*
Oops, something went wrong.

0 comments on commit 1c062a6

Please sign in to comment.