2018-03-07 08:35:42 +00:00
|
|
|
benchmarks_protoc_inputs_benchmark_wrapper = \
|
|
|
|
benchmarks.proto
|
|
|
|
|
2017-12-01 19:55:38 +00:00
|
|
|
benchmarks_protoc_inputs = \
|
2018-03-07 08:35:42 +00:00
|
|
|
datasets/google_message1/proto3/benchmark_message1_proto3.proto
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
benchmarks_protoc_inputs_proto2 = \
|
2018-03-07 08:35:42 +00:00
|
|
|
datasets/google_message1/proto2/benchmark_message1_proto2.proto \
|
2017-12-01 19:55:38 +00:00
|
|
|
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
|
|
|
|
|
2017-12-04 22:39:08 +00:00
|
|
|
make_tmp_dir:
|
2017-12-12 20:05:29 +00:00
|
|
|
mkdir -p 'tmp/java/src/main/java'
|
2017-12-04 22:39:08 +00:00
|
|
|
touch make_tmp_dir
|
2016-05-06 16:47:41 +00:00
|
|
|
|
2019-02-27 00:23:18 +00:00
|
|
|
|
2016-04-28 01:22:22 +00:00
|
|
|
# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
|
|
|
|
# relative to srcdir, which may not be the same as the current directory when
|
|
|
|
# building out-of-tree.
|
2018-03-07 08:35:42 +00:00
|
|
|
protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper)
|
2018-04-10 21:32:28 +00:00
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
2016-04-28 01:22:22 +00:00
|
|
|
touch protoc_middleman
|
|
|
|
|
2017-12-04 22:39:08 +00:00
|
|
|
protoc_middleman2: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs)
|
2018-04-10 21:32:28 +00:00
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2) )
|
2017-12-01 19:55:38 +00:00
|
|
|
touch protoc_middleman2
|
2018-01-09 18:24:50 +00:00
|
|
|
|
2018-07-16 20:53:22 +00:00
|
|
|
all_data = $$(find $$(cd $(srcdir) && pwd) -type f -name "dataset.*.pb" -not -path "$$(cd $(srcdir) && pwd)/tmp/*")
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
############# CPP RULES ##############
|
|
|
|
|
|
|
|
benchmarks_protoc_outputs = \
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp/benchmarks.pb.cc \
|
|
|
|
cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc
|
|
|
|
|
2017-12-01 19:55:38 +00:00
|
|
|
benchmarks_protoc_outputs_header = \
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp/benchmarks.pb.h \
|
|
|
|
cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
benchmarks_protoc_outputs_proto2_header = \
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \
|
|
|
|
cpp/datasets/google_message2/benchmark_message2.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_1.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_2.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_3.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_4.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_5.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_6.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_7.pb.h \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_8.pb.h \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4.pb.h \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_1.pb.h \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_2.pb.h \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_3.pb.h
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
benchmarks_protoc_outputs_proto2 = \
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \
|
|
|
|
cpp/datasets/google_message2/benchmark_message2.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_1.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_2.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_3.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_4.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_5.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_6.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_7.pb.cc \
|
|
|
|
cpp/datasets/google_message3/benchmark_message3_8.pb.cc \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4.pb.cc \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_1.pb.cc \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_2.pb.cc \
|
|
|
|
cpp/datasets/google_message4/benchmark_message4_3.pb.cc
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
$(benchmarks_protoc_outputs): protoc_middleman
|
|
|
|
$(benchmarks_protoc_outputs_header): protoc_middleman
|
|
|
|
$(benchmarks_protoc_outputs_proto2): protoc_middleman2
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header): protoc_middleman2
|
|
|
|
|
2017-12-15 01:26:16 +00:00
|
|
|
initialize_submodule:
|
|
|
|
oldpwd=`pwd`
|
2019-02-26 20:52:06 +00:00
|
|
|
cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \
|
|
|
|
cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make
|
2017-12-15 01:26:16 +00:00
|
|
|
cd $$oldpwd
|
|
|
|
touch initialize_submodule
|
2018-04-10 21:32:28 +00:00
|
|
|
|
2017-12-15 01:26:16 +00:00
|
|
|
$(top_srcdir)/third_party/benchmark/src/libbenchmark.a: initialize_submodule
|
|
|
|
|
2017-12-01 19:55:38 +00:00
|
|
|
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
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp_benchmark_SOURCES = cpp/cpp_benchmark.cc
|
|
|
|
cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(top_srcdir)/third_party/benchmark/include
|
2017-12-01 19:55:38 +00:00
|
|
|
# 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
|
2018-04-10 21:32:28 +00:00
|
|
|
cpp/cpp_benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
|
2018-07-06 19:25:52 +00:00
|
|
|
cpp/benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
|
2017-12-01 19:55:38 +00:00
|
|
|
nodist_cpp_benchmark_SOURCES = \
|
|
|
|
$(benchmarks_protoc_outputs) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header) \
|
|
|
|
$(benchmarks_protoc_outputs_header)
|
|
|
|
|
2017-12-15 01:26:16 +00:00
|
|
|
cpp: protoc_middleman protoc_middleman2 cpp-benchmark initialize_submodule
|
2017-12-01 19:55:38 +00:00
|
|
|
./cpp-benchmark $(all_data)
|
|
|
|
|
|
|
|
############ CPP RULES END ############
|
|
|
|
|
|
|
|
############# JAVA RULES ##############
|
|
|
|
|
2017-12-15 01:26:16 +00:00
|
|
|
java_benchmark_testing_files = \
|
2018-02-09 19:47:00 +00:00
|
|
|
java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java
|
2017-12-12 20:05:29 +00:00
|
|
|
|
|
|
|
javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2
|
2019-02-21 03:28:50 +00:00
|
|
|
cp -r $(srcdir)/java tmp
|
2018-05-21 21:56:56 +00:00
|
|
|
mkdir -p tmp/java/lib
|
|
|
|
cp $(top_srcdir)/java/core/target/*.jar tmp/java/lib/protobuf-java.jar
|
|
|
|
cd tmp/java && mvn clean compile assembly:single -Dprotobuf.version=$(PACKAGE_VERSION) && cd ../..
|
2017-12-01 19:55:38 +00:00
|
|
|
@touch javac_middleman
|
|
|
|
|
2018-01-09 18:24:50 +00:00
|
|
|
java-benchmark: javac_middleman
|
2017-12-01 19:55:38 +00:00
|
|
|
@echo "Writing shortcut script java-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > java-benchmark
|
2018-04-13 21:54:58 +00:00
|
|
|
@echo 'all_data=""' >> java-benchmark
|
|
|
|
@echo 'conf=()' >> java-benchmark
|
|
|
|
@echo 'data_files=""' >> java-benchmark
|
|
|
|
@echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+="$$arg,"; fi; done' >> java-benchmark
|
2018-05-21 21:56:56 +00:00
|
|
|
@echo 'java -cp '\"tmp/java/target/*:$(top_srcdir)/java/core/target/*:$(top_srcdir)/java/util/target/*\"" \\" >>java-benchmark
|
|
|
|
@echo ' com.google.caliper.runner.CaliperMain com.google.protobuf.ProtoCaliperBenchmark -i runtime '"\\" >> java-benchmark
|
|
|
|
@echo ' -b serializeToByteArray,serializeToMemoryStream,deserializeFromByteArray,deserializeFromMemoryStream '"\\" >> java-benchmark
|
|
|
|
@echo ' -DdataFile=$${data_files:0:-1} $${conf[*]}' >> java-benchmark
|
2017-12-01 19:55:38 +00:00
|
|
|
@chmod +x java-benchmark
|
|
|
|
|
|
|
|
java: protoc_middleman protoc_middleman2 java-benchmark
|
|
|
|
./java-benchmark $(all_data)
|
|
|
|
|
|
|
|
############# JAVA RULES END ##############
|
|
|
|
|
2018-01-05 19:20:40 +00:00
|
|
|
|
|
|
|
############# PYTHON RULES ##############
|
|
|
|
|
|
|
|
python_add_init: protoc_middleman protoc_middleman2
|
|
|
|
all_file=`find tmp -type f -regex '.*\.py'` && \
|
|
|
|
for file in $${all_file[@]}; do \
|
|
|
|
path="$${file%/*}"; \
|
|
|
|
while true; do \
|
|
|
|
touch "$$path/__init__.py" && chmod +x "$$path/__init__.py"; \
|
|
|
|
if [[ $$path != *"/"* ]]; then break; fi; \
|
|
|
|
path=$${path%/*}; \
|
|
|
|
done \
|
|
|
|
done
|
|
|
|
|
|
|
|
python_cpp_pkg_flags = `pkg-config --cflags --libs python`
|
|
|
|
|
|
|
|
lib_LTLIBRARIES = libbenchmark_messages.la
|
2018-04-10 21:32:28 +00:00
|
|
|
libbenchmark_messages_la_SOURCES = python/python_benchmark_messages.cc
|
2018-01-09 18:24:50 +00:00
|
|
|
libbenchmark_messages_la_LIBADD = $(top_srcdir)/src/.libs/libprotobuf.la
|
2018-01-05 19:20:40 +00:00
|
|
|
libbenchmark_messages_la_LDFLAGS = -version-info 1:0:0 -export-dynamic
|
2018-04-10 21:32:28 +00:00
|
|
|
libbenchmark_messages_la_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp $(python_cpp_pkg_flags)
|
|
|
|
libbenchmark_messages_la-python_benchmark_messages.$(OBJEXT): $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2)
|
2018-01-05 19:20:40 +00:00
|
|
|
nodist_libbenchmark_messages_la_SOURCES = \
|
|
|
|
$(benchmarks_protoc_outputs) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header) \
|
|
|
|
$(benchmarks_protoc_outputs_header)
|
|
|
|
|
|
|
|
python-pure-python-benchmark: python_add_init
|
|
|
|
@echo "Writing shortcut script python-pure-python-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > python-pure-python-benchmark
|
2018-05-22 01:59:39 +00:00
|
|
|
@echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark
|
|
|
|
@echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'python\' >> python-pure-python-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo cp $(srcdir)/python/py_benchmark.py tmp >> python-pure-python-benchmark
|
2018-04-10 20:26:17 +00:00
|
|
|
@echo python tmp/py_benchmark.py '$$@' >> python-pure-python-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@chmod +x python-pure-python-benchmark
|
|
|
|
|
|
|
|
python-cpp-reflection-benchmark: python_add_init
|
|
|
|
@echo "Writing shortcut script python-cpp-reflection-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > python-cpp-reflection-benchmark
|
2018-05-22 01:59:39 +00:00
|
|
|
@echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark
|
|
|
|
@echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-reflection-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-reflection-benchmark
|
2018-04-10 20:26:17 +00:00
|
|
|
@echo python tmp/py_benchmark.py '$$@' >> python-cpp-reflection-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@chmod +x python-cpp-reflection-benchmark
|
|
|
|
|
|
|
|
python-cpp-generated-code-benchmark: python_add_init libbenchmark_messages.la
|
|
|
|
@echo "Writing shortcut script python-cpp-generated-code-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > python-cpp-generated-code-benchmark
|
2018-05-22 01:59:39 +00:00
|
|
|
@echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark
|
|
|
|
@echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-generated-code-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-generated-code-benchmark
|
2018-04-10 20:26:17 +00:00
|
|
|
@echo python tmp/py_benchmark.py --cpp_generated '$$@' >> python-cpp-generated-code-benchmark
|
2018-01-05 19:20:40 +00:00
|
|
|
@chmod +x python-cpp-generated-code-benchmark
|
|
|
|
|
|
|
|
python-pure-python: python-pure-python-benchmark
|
|
|
|
./python-pure-python-benchmark $(all_data)
|
|
|
|
|
|
|
|
python-cpp-reflection: python-cpp-reflection-benchmark
|
|
|
|
./python-cpp-reflection-benchmark $(all_data)
|
|
|
|
|
|
|
|
python-cpp-generated-code: python-cpp-generated-code-benchmark
|
|
|
|
./python-cpp-generated-code-benchmark $(all_data)
|
|
|
|
|
|
|
|
############# PYTHON RULES END ##############
|
|
|
|
|
2018-03-07 08:35:42 +00:00
|
|
|
############# GO RULES BEGIN ##############
|
|
|
|
|
|
|
|
benchmarks_protoc_inputs_proto2_message1 = \
|
|
|
|
datasets/google_message1/proto2/benchmark_message1_proto2.proto
|
|
|
|
|
|
|
|
benchmarks_protoc_inputs_proto2_message2 = \
|
|
|
|
datasets/google_message2/benchmark_message2.proto
|
|
|
|
|
|
|
|
benchmarks_protoc_inputs_proto2_message3 = \
|
|
|
|
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
|
|
|
|
|
|
|
|
benchmarks_protoc_inputs_proto2_message4 = \
|
|
|
|
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
|
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
go_protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_proto2_message1) $(benchmarks_protoc_inputs_proto2_message2) $(benchmarks_protoc_inputs_proto2_message3) $(benchmarks_protoc_inputs_proto2_message4) $(well_known_type_protoc_inputs)
|
2018-03-07 08:35:42 +00:00
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message4) )
|
2018-04-10 21:32:28 +00:00
|
|
|
touch go_protoc_middleman
|
2018-03-07 08:35:42 +00:00
|
|
|
|
2019-02-21 03:28:50 +00:00
|
|
|
go-benchmark: go_protoc_middleman
|
2018-03-07 08:35:42 +00:00
|
|
|
@echo "Writing shortcut script go-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > go-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo 'cd $(srcdir)/go' >> go-benchmark
|
|
|
|
@echo 'all_data=""' >> go-benchmark
|
2018-04-10 20:26:17 +00:00
|
|
|
@echo 'conf=()' >> go-benchmark
|
|
|
|
@echo 'data_files=()' >> go-benchmark
|
2018-09-25 23:05:16 +00:00
|
|
|
@echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+=("$$arg"); fi; done' >> go-benchmark
|
2018-04-10 20:26:17 +00:00
|
|
|
@echo 'go test -bench=. $${conf[*]} -- $${data_files[*]}' >> go-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo 'cd ..' >> go-benchmark
|
2018-03-07 08:35:42 +00:00
|
|
|
@chmod +x go-benchmark
|
|
|
|
|
2019-02-21 03:28:50 +00:00
|
|
|
go: go_protoc_middleman go-benchmark
|
2018-03-07 08:35:42 +00:00
|
|
|
./go-benchmark $(all_data)
|
|
|
|
|
|
|
|
############# GO RULES END ##############
|
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
############# GOGO RULES BEGIN ############
|
|
|
|
|
|
|
|
cpp_no_group_benchmarks_protoc_outputs_header = \
|
|
|
|
gogo/cpp_no_group/benchmarks.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h
|
|
|
|
|
|
|
|
cpp_no_group_benchmarks_protoc_outputs = \
|
|
|
|
gogo/cpp_no_group/benchmarks.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc
|
|
|
|
|
|
|
|
cpp_no_group_benchmarks_protoc_outputs_proto2_header = \
|
|
|
|
gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.h \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.h
|
|
|
|
|
|
|
|
cpp_no_group_benchmarks_protoc_outputs_proto2 = \
|
|
|
|
gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc \
|
|
|
|
gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc
|
|
|
|
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs): cpp_no_group_protoc_middleman
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_header): cpp_no_group_protoc_middleman
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2): cpp_no_group_protoc_middleman
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2_header): cpp_no_group_protoc_middleman
|
|
|
|
|
|
|
|
generate_cpp_no_group_benchmark_code:
|
|
|
|
cp $(srcdir)/cpp/cpp_benchmark.cc gogo/cpp_no_group/cpp_benchmark.cc
|
|
|
|
sed -i -e "s/\#include \"datasets/\#include \"gogo\/cpp_no_group\/datasets/g" gogo/cpp_no_group/cpp_benchmark.cc
|
2019-02-21 03:28:50 +00:00
|
|
|
sed -i -e "s/\#include \"benchmarks.pb.h/\#include \"gogo\/cpp_no_group\/benchmarks.pb.h/g" gogo/cpp_no_group/cpp_benchmark.cc
|
2018-04-10 21:32:28 +00:00
|
|
|
touch generate_cpp_no_group_benchmark_code
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
bin_PROGRAMS += cpp-no-group-benchmark
|
|
|
|
cpp_no_group_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
|
|
|
|
cpp_no_group_benchmark_SOURCES = gogo/cpp_no_group/cpp_benchmark.cc
|
|
|
|
cpp_no_group_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/gogo/cpp_no_group -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
|
|
|
|
gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT): $(cpp_no_group_benchmarks_protoc_outputs) $(cpp_no_group_benchmarks_protoc_outputs_proto2) $(cpp_no_group_benchmarks_protoc_outputs_header) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/third_party/benchmark/src/libbenchmark.a generate_cpp_no_group_benchmark_code
|
|
|
|
gogo/cpp_no_group/cpp_benchmark.cc: generate_cpp_no_group_benchmark_code
|
|
|
|
nodist_cpp_no_group_benchmark_SOURCES = \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_header) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2_header)
|
|
|
|
|
|
|
|
cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark
|
|
|
|
./cpp-no-group-benchmark $(gogo_data)
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
gogo_proto_middleman: protoc-gen-gogoproto
|
|
|
|
mkdir -p "tmp/gogo_proto"
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-gogoproto --gogoproto_out=$$oldpwd/tmp/gogo_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
|
|
|
|
touch gogo_proto_middleman
|
|
|
|
|
2018-05-31 00:06:45 +00:00
|
|
|
gogo_data = $$(for data in $(all_data); do echo "tmp/gogo_data$${data\#$(srcdir)}"; done | xargs)
|
2018-04-10 21:32:28 +00:00
|
|
|
|
|
|
|
generate_gogo_data: protoc_middleman protoc_middleman2 gogo-data-scrubber
|
2018-05-31 00:06:45 +00:00
|
|
|
mkdir -p `dirname $(gogo_data)`
|
|
|
|
./gogo-data-scrubber $(all_data) $(gogo_data)
|
2018-04-10 21:32:28 +00:00
|
|
|
touch generate_gogo_data
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
make_tmp_dir_gogo:
|
|
|
|
mkdir -p tmp/go_no_group/benchmark_code
|
|
|
|
mkdir -p tmp/gogofast/benchmark_code
|
|
|
|
mkdir -p tmp/gogofaster/benchmark_code
|
|
|
|
mkdir -p tmp/gogoslick/benchmark_code
|
|
|
|
touch make_tmp_dir_gogo
|
|
|
|
|
|
|
|
go_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message4) )
|
|
|
|
touch go_no_group_protoc_middleman
|
|
|
|
|
|
|
|
cpp_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message4) )
|
|
|
|
touch cpp_no_group_protoc_middleman
|
|
|
|
|
|
|
|
gogofast_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message4) )
|
|
|
|
touch gogofast_protoc_middleman
|
|
|
|
|
|
|
|
gogofaster_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message4) )
|
|
|
|
touch gogofaster_protoc_middleman
|
|
|
|
|
|
|
|
gogoslick_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_benchmark_wrapper) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message1) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message2) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message3) )
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message4) )
|
|
|
|
touch gogoslick_protoc_middleman
|
|
|
|
|
|
|
|
generate-gogo-benchmark-code:
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > generate-gogo-benchmark-code
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo 'cp $(srcdir)/go/go_benchmark_test.go tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
|
|
|
|
@echo 'sed -i -e "s/\.\.\/tmp/../g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
|
|
|
|
@echo 'sed -i -e "s/b\.Run(\"\(.*\)\"/b.Run(\"\1\_$$1\"/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
|
|
|
|
@echo 'if [[ $$2 == 1 ]]; then sed -i -e "s/github\.com\/golang/github.com\/gogo/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go; fi ' >> generate-gogo-benchmark-code
|
|
|
|
@chmod +x generate-gogo-benchmark-code
|
|
|
|
|
|
|
|
generate_all_gogo_benchmark_code: generate-gogo-benchmark-code make_tmp_dir_gogo
|
|
|
|
./generate-gogo-benchmark-code go_no_group 0
|
|
|
|
./generate-gogo-benchmark-code gogofast 1
|
|
|
|
./generate-gogo-benchmark-code gogofaster 1
|
|
|
|
./generate-gogo-benchmark-code gogoslick 1
|
|
|
|
|
|
|
|
gogo-benchmark:
|
|
|
|
@echo "Writing shortcut script gogo-benchmark..."
|
2018-04-17 00:01:18 +00:00
|
|
|
@echo '#! /bin/bash' > gogo-benchmark
|
2018-04-10 21:32:28 +00:00
|
|
|
@echo 'cd tmp/$$1/benchmark_code' >> gogo-benchmark
|
|
|
|
@echo 'shift' >> gogo-benchmark
|
|
|
|
@echo 'all_data=""' >> gogo-benchmark
|
|
|
|
@echo 'for data_file in $$@; do all_data="$$all_data ../../../$$data_file"; done' >> gogo-benchmark
|
|
|
|
@echo 'go test -bench=. -- $$all_data' >> gogo-benchmark
|
|
|
|
@echo 'cd ../..' >> gogo-benchmark
|
|
|
|
@chmod +x gogo-benchmark
|
|
|
|
|
|
|
|
go_no_group: go_no_group_protoc_middleman generate_gogo_data generate_all_gogo_benchmark_code gogo-benchmark
|
|
|
|
./gogo-benchmark go_no_group $(gogo_data)
|
2019-02-21 03:28:50 +00:00
|
|
|
|
|
|
|
gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
|
2018-04-10 21:32:28 +00:00
|
|
|
./gogo-benchmark gogofast $(gogo_data)
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
gogofaster: gogofaster_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
|
|
|
|
./gogo-benchmark gogofaster $(gogo_data)
|
|
|
|
|
|
|
|
gogoslick: gogoslick_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
|
|
|
|
./gogo-benchmark gogoslick $(gogo_data)
|
|
|
|
|
|
|
|
|
|
|
|
############# GOGO RULES END ############
|
|
|
|
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
############ UTIL RULES BEGIN ############
|
|
|
|
|
2018-05-31 00:06:45 +00:00
|
|
|
bin_PROGRAMS += protoc-gen-gogoproto gogo-data-scrubber protoc-gen-proto2_to_proto3 proto3-data-stripper
|
2018-04-10 21:32:28 +00:00
|
|
|
|
|
|
|
protoc_gen_gogoproto_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la
|
|
|
|
protoc_gen_gogoproto_SOURCES = util/protoc-gen-gogoproto.cc
|
|
|
|
protoc_gen_gogoproto_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
|
|
|
|
|
|
|
|
gogo_data_scrubber_LDADD = $(top_srcdir)/src/libprotobuf.la
|
|
|
|
gogo_data_scrubber_SOURCES = util/gogo_data_scrubber.cc
|
|
|
|
gogo_data_scrubber_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
|
|
|
|
util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header)
|
|
|
|
nodist_gogo_data_scrubber_SOURCES = \
|
|
|
|
$(benchmarks_protoc_outputs) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header) \
|
|
|
|
$(benchmarks_protoc_outputs_header)
|
2018-05-31 00:06:45 +00:00
|
|
|
|
|
|
|
protoc_gen_proto2_to_proto3_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la
|
|
|
|
protoc_gen_proto2_to_proto3_SOURCES = util/protoc-gen-proto2_to_proto3.cc
|
|
|
|
protoc_gen_proto2_to_proto3_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
|
|
|
|
|
|
|
|
proto3_data_stripper_LDADD = $(top_srcdir)/src/libprotobuf.la
|
|
|
|
proto3_data_stripper_SOURCES = util/proto3_data_stripper.cc
|
|
|
|
proto3_data_stripper_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
|
|
|
|
util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header)
|
|
|
|
nodist_proto3_data_stripper_SOURCES = \
|
|
|
|
$(benchmarks_protoc_outputs) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header) \
|
|
|
|
$(benchmarks_protoc_outputs_header)
|
|
|
|
|
2019-02-21 03:28:50 +00:00
|
|
|
|
2018-04-10 21:32:28 +00:00
|
|
|
############ UTIL RULES END ############
|
2018-03-07 08:35:42 +00:00
|
|
|
|
2018-05-31 00:06:45 +00:00
|
|
|
############ PROTO3 PREPARATION BEGIN #############
|
|
|
|
|
|
|
|
proto3_proto_middleman: protoc-gen-proto2_to_proto3
|
|
|
|
mkdir -p "tmp/proto3_proto"
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-proto2_to_proto3 --proto2_to_proto3_out=$$oldpwd/tmp/proto3_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
|
|
|
|
touch proto3_proto_middleman
|
|
|
|
|
2018-07-16 20:53:22 +00:00
|
|
|
full_srcdir = $$(cd $(srcdir) && pwd)
|
|
|
|
proto3_data = $$(for data in $(all_data); do echo $(full_srcdir)"/tmp/proto3_data$${data\#$(full_srcdir)}"; done | xargs)
|
2018-05-31 00:06:45 +00:00
|
|
|
|
|
|
|
generate_proto3_data: protoc_middleman protoc_middleman2 proto3-data-stripper
|
|
|
|
mkdir -p `dirname $(proto3_data)`
|
|
|
|
./proto3-data-stripper $(all_data) $(proto3_data)
|
|
|
|
touch generate_proto3_data
|
|
|
|
|
|
|
|
############ PROTO3 PREPARATION END #############
|
|
|
|
|
2018-07-16 20:53:22 +00:00
|
|
|
############ PHP RULES BEGIN #################
|
|
|
|
|
|
|
|
proto3_middleman_php: proto3_proto_middleman
|
|
|
|
mkdir -p "tmp/php"
|
|
|
|
oldpwd=`pwd` && ( cd tmp/proto3_proto && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --php_out=$$oldpwd/tmp/php $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
|
|
|
|
touch proto3_middleman_php
|
|
|
|
|
|
|
|
php-benchmark: proto3_middleman_php generate_proto3_data
|
|
|
|
mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
|
2019-02-21 03:28:50 +00:00
|
|
|
cp php/autoload.php "tmp/php"
|
2018-07-16 20:53:22 +00:00
|
|
|
@echo "Writing shortcut script php-benchmark..."
|
|
|
|
@echo '#! /bin/bash' > php-benchmark
|
|
|
|
@echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark
|
|
|
|
@echo 'cd tmp/php' >> php-benchmark
|
|
|
|
@echo 'export CURRENT_DIR=$$(pwd)' >> php-benchmark
|
|
|
|
@echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-benchmark
|
|
|
|
@echo 'cd ../..' >> php-benchmark
|
|
|
|
@chmod +x php-benchmark
|
|
|
|
|
|
|
|
php: php-benchmark proto3_middleman_php
|
2018-12-21 01:15:51 +00:00
|
|
|
./php-benchmark --behavior_prefix="php" $(proto3_data)
|
2018-07-16 20:53:22 +00:00
|
|
|
|
|
|
|
php_c_extension:
|
2018-12-21 01:15:51 +00:00
|
|
|
cd $(top_srcdir)/php/ext/google/protobuf && phpize && ./configure CFLAGS='-O3' && make -j8
|
2018-07-16 20:53:22 +00:00
|
|
|
|
|
|
|
php-c-benchmark: proto3_middleman_php generate_proto3_data php_c_extension php_c_extension
|
2019-02-21 03:28:50 +00:00
|
|
|
mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
|
|
|
|
cp php/autoload.php "tmp/php"
|
2018-07-16 20:53:22 +00:00
|
|
|
@echo "Writing shortcut script php-c-benchmark..."
|
|
|
|
@echo '#! /bin/bash' > php-c-benchmark
|
|
|
|
@echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-c-benchmark
|
|
|
|
@echo 'export PROTOBUF_PHP_EXTDIR="$$PROTOBUF_PHP_SRCDIR/../ext/google/protobuf/modules"' >> php-c-benchmark
|
|
|
|
@echo 'cd tmp/php' >> php-c-benchmark
|
|
|
|
@echo 'export CURRENT_DIR=$$(pwd)' >> php-c-benchmark
|
|
|
|
@echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" -d extension="$$PROTOBUF_PHP_EXTDIR/protobuf.so" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-c-benchmark
|
|
|
|
@echo 'cd ../..' >> php-c-benchmark
|
|
|
|
@chmod +x php-c-benchmark
|
|
|
|
|
|
|
|
php_c: php-c-benchmark proto3_middleman_php
|
2018-12-21 01:15:51 +00:00
|
|
|
./php-c-benchmark --behavior_prefix="php_c" $(proto3_data)
|
2018-07-16 20:53:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
############ PHP RULES END #################
|
|
|
|
|
2018-07-20 23:13:19 +00:00
|
|
|
############ protobuf.js RULE BEGIN #############
|
|
|
|
|
|
|
|
pbjs_preparation:
|
|
|
|
mkdir -p tmp/protobuf.js
|
|
|
|
cd tmp/protobuf.js && git clone https://github.com/dcodeIO/protobuf.js.git && \
|
|
|
|
cd protobuf.js && npm install && npm run build
|
|
|
|
cd tmp/protobuf.js && npm install benchmark
|
|
|
|
cp protobuf.js/* tmp/protobuf.js
|
2018-08-08 18:24:09 +00:00
|
|
|
cp js/benchmark_suite.js tmp/protobuf.js
|
2018-07-20 23:13:19 +00:00
|
|
|
touch pbjs_preparation
|
|
|
|
|
|
|
|
pbjs_middleman: pbjs_preparation
|
2018-08-08 18:24:09 +00:00
|
|
|
export OLDDIR=$$(pwd) && cd tmp/protobuf.js && node generate_pbjs_files.js --target static-module --include_path=$$OLDDIR -o generated_bundle_code.js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2)
|
2018-07-20 23:13:19 +00:00
|
|
|
touch pbjs_middleman
|
|
|
|
|
|
|
|
pbjs-benchmark: pbjs_middleman
|
|
|
|
@echo '#! /bin/bash' > pbjs-benchmark
|
|
|
|
@echo 'cd tmp/protobuf.js' >> pbjs-benchmark
|
2018-08-08 18:24:09 +00:00
|
|
|
@echo 'sed -i "s/protobufjs/.\/protobuf.js/g" generated_bundle_code.js' >> pbjs-benchmark
|
|
|
|
@echo 'env NODE_PATH=".:./node_modules:$$NODE_PATH" node protobufjs_benchmark.js $$@' >> pbjs-benchmark
|
2018-07-20 23:13:19 +00:00
|
|
|
@chmod +x pbjs-benchmark
|
|
|
|
|
|
|
|
pbjs: pbjs-benchmark
|
|
|
|
./pbjs-benchmark $(all_data)
|
|
|
|
|
|
|
|
############ protobuf.js RULE END #############
|
|
|
|
|
|
|
|
############ JS RULE BEGIN #############
|
|
|
|
|
|
|
|
js_preparation:
|
|
|
|
mkdir -p tmp/js
|
|
|
|
oldpwd=$$(pwd) && cd $(top_srcdir)/js && npm install && npm test
|
|
|
|
cd tmp/js && npm install benchmark
|
|
|
|
cp js/* tmp/js
|
|
|
|
touch js_preparation
|
|
|
|
|
|
|
|
js_middleman: js_preparation
|
|
|
|
oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --js_out=import_style=commonjs,binary:$$oldpwd/tmp/js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2))
|
|
|
|
touch js_middleman
|
|
|
|
|
|
|
|
js-benchmark: js_middleman
|
|
|
|
@echo '#! /bin/bash' > js-benchmark
|
|
|
|
@echo 'export TOP_JS_SRCDIR=$$(cd $(top_srcdir)/js && pwd)' >> js-benchmark
|
|
|
|
@echo 'cd tmp/js' >> js-benchmark
|
2018-08-08 18:24:09 +00:00
|
|
|
@echo 'env NODE_PATH="$$TOP_JS_SRCDIR:.:./node_modules:$$NODE_PATH" node --max-old-space-size=4096 js_benchmark.js $$@' >> js-benchmark
|
2018-07-20 23:13:19 +00:00
|
|
|
@chmod +x js-benchmark
|
|
|
|
|
|
|
|
js: js-benchmark
|
|
|
|
./js-benchmark $(all_data)
|
|
|
|
|
|
|
|
############ JS RULE END #############
|
|
|
|
|
2019-08-27 20:16:28 +00:00
|
|
|
EXTRA_DIST = \
|
|
|
|
$(benchmarks_protoc_inputs_benchmark_wrapper) \
|
|
|
|
$(benchmarks_protoc_inputs) \
|
|
|
|
$(benchmarks_protoc_inputs_proto2) \
|
|
|
|
google_size.proto
|
|
|
|
|
2017-12-04 22:39:08 +00:00
|
|
|
MAINTAINERCLEANFILES = \
|
|
|
|
Makefile.in
|
|
|
|
|
2017-12-01 19:55:38 +00:00
|
|
|
CLEANFILES = \
|
|
|
|
$(benchmarks_protoc_outputs) \
|
|
|
|
$(benchmarks_protoc_outputs_header) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2) \
|
|
|
|
$(benchmarks_protoc_outputs_proto2_header) \
|
2017-12-15 01:26:16 +00:00
|
|
|
initialize_submodule \
|
2017-12-04 22:39:08 +00:00
|
|
|
make_tmp_dir \
|
2017-12-01 19:55:38 +00:00
|
|
|
protoc_middleman \
|
|
|
|
protoc_middleman2 \
|
|
|
|
javac_middleman \
|
2018-01-05 19:20:40 +00:00
|
|
|
java-benchmark \
|
|
|
|
python_cpp_proto_library \
|
|
|
|
python-pure-python-benchmark \
|
|
|
|
python-cpp-reflection-benchmark \
|
2018-03-07 08:35:42 +00:00
|
|
|
python-cpp-generated-code-benchmark \
|
|
|
|
go-benchmark \
|
|
|
|
go_protoc_middleman \
|
2018-04-10 21:32:28 +00:00
|
|
|
make_tmp_dir_gogo \
|
|
|
|
gogo_proto_middleman \
|
|
|
|
generate_gogo_data \
|
|
|
|
go_no_group_protoc_middleman \
|
|
|
|
go_no_group \
|
|
|
|
go-no-group-benchmark \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_header) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2_header) \
|
|
|
|
$(cpp_no_group_benchmarks_protoc_outputs_proto2) \
|
|
|
|
generate_all_gogo_benchmark_code \
|
|
|
|
generate-gogo-benchmark-code \
|
|
|
|
cpp_no_group_protoc_middleman \
|
|
|
|
generate_cpp_no_group_benchmark_code \
|
|
|
|
generate_gogo_benchmark_code \
|
|
|
|
gogofast_protoc_middleman \
|
|
|
|
gogofast \
|
|
|
|
gogofaster_protoc_middleman \
|
|
|
|
gogofaster \
|
|
|
|
gogoslick_protoc_middleman \
|
|
|
|
gogoslick \
|
|
|
|
gogo-benchmark \
|
2018-05-31 00:06:45 +00:00
|
|
|
gogo/cpp_no_group/cpp_benchmark.* \
|
|
|
|
proto3_proto_middleman \
|
2018-07-16 20:53:22 +00:00
|
|
|
generate_proto3_data \
|
|
|
|
php-benchmark \
|
|
|
|
php-c-benchmark \
|
2018-07-20 23:13:19 +00:00
|
|
|
proto3_middleman_php \
|
|
|
|
pbjs_preparation \
|
|
|
|
pbjs_middleman \
|
|
|
|
pbjs-benchmark \
|
|
|
|
js_preparation \
|
|
|
|
js_middleman \
|
|
|
|
js-benchmark
|
2017-12-01 19:55:38 +00:00
|
|
|
|
|
|
|
clean-local:
|
|
|
|
-rm -rf tmp/*
|
2019-02-21 03:28:50 +00:00
|
|
|
|