Skip to content

Commit

Permalink
Refine to just be a HPACK benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Feb 23, 2017
1 parent 0db30f3 commit 523d54b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 28 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bm_call_create)
endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bm_chttp2)
add_dependencies(buildtests_cxx bm_chttp2_hpack)
endif()
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)
add_dependencies(buildtests_cxx bm_closure)
Expand Down Expand Up @@ -7407,13 +7407,13 @@ endif (gRPC_BUILD_TESTS)
if (gRPC_BUILD_TESTS)
if(_gRPC_PLATFORM_LINUX OR _gRPC_PLATFORM_MAC OR _gRPC_PLATFORM_POSIX)

add_executable(bm_chttp2
test/cpp/microbenchmarks/bm_chttp2.cc
add_executable(bm_chttp2_hpack
test/cpp/microbenchmarks/bm_chttp2_hpack.cc
third_party/googletest/src/gtest-all.cc
)


target_include_directories(bm_chttp2
target_include_directories(bm_chttp2_hpack
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${BORINGSSL_ROOT_DIR}/include
Expand All @@ -7427,7 +7427,7 @@ target_include_directories(bm_chttp2
PRIVATE ${_gRPC_PROTO_GENS_DIR}
)

target_link_libraries(bm_chttp2
target_link_libraries(bm_chttp2_hpack
${_gRPC_PROTOBUF_LIBRARIES}
${_gRPC_ALLTARGETS_LIBRARIES}
benchmark
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ alarm_cpp_test: $(BINDIR)/$(CONFIG)/alarm_cpp_test
async_end2end_test: $(BINDIR)/$(CONFIG)/async_end2end_test
auth_property_iterator_test: $(BINDIR)/$(CONFIG)/auth_property_iterator_test
bm_call_create: $(BINDIR)/$(CONFIG)/bm_call_create
bm_chttp2: $(BINDIR)/$(CONFIG)/bm_chttp2
bm_chttp2_hpack: $(BINDIR)/$(CONFIG)/bm_chttp2_hpack
bm_closure: $(BINDIR)/$(CONFIG)/bm_closure
bm_cq: $(BINDIR)/$(CONFIG)/bm_cq
bm_error: $(BINDIR)/$(CONFIG)/bm_error
Expand Down Expand Up @@ -1450,7 +1450,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/async_end2end_test \
$(BINDIR)/$(CONFIG)/auth_property_iterator_test \
$(BINDIR)/$(CONFIG)/bm_call_create \
$(BINDIR)/$(CONFIG)/bm_chttp2 \
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack \
$(BINDIR)/$(CONFIG)/bm_closure \
$(BINDIR)/$(CONFIG)/bm_cq \
$(BINDIR)/$(CONFIG)/bm_error \
Expand Down Expand Up @@ -1560,7 +1560,7 @@ buildtests_cxx: privatelibs_cxx \
$(BINDIR)/$(CONFIG)/async_end2end_test \
$(BINDIR)/$(CONFIG)/auth_property_iterator_test \
$(BINDIR)/$(CONFIG)/bm_call_create \
$(BINDIR)/$(CONFIG)/bm_chttp2 \
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack \
$(BINDIR)/$(CONFIG)/bm_closure \
$(BINDIR)/$(CONFIG)/bm_cq \
$(BINDIR)/$(CONFIG)/bm_error \
Expand Down Expand Up @@ -1882,8 +1882,8 @@ test_cxx: buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/auth_property_iterator_test || ( echo test auth_property_iterator_test failed ; exit 1 )
$(E) "[RUN] Testing bm_call_create"
$(Q) $(BINDIR)/$(CONFIG)/bm_call_create || ( echo test bm_call_create failed ; exit 1 )
$(E) "[RUN] Testing bm_chttp2"
$(Q) $(BINDIR)/$(CONFIG)/bm_chttp2 || ( echo test bm_chttp2 failed ; exit 1 )
$(E) "[RUN] Testing bm_chttp2_hpack"
$(Q) $(BINDIR)/$(CONFIG)/bm_chttp2_hpack || ( echo test bm_chttp2_hpack failed ; exit 1 )
$(E) "[RUN] Testing bm_closure"
$(Q) $(BINDIR)/$(CONFIG)/bm_closure || ( echo test bm_closure failed ; exit 1 )
$(E) "[RUN] Testing bm_cq"
Expand Down Expand Up @@ -12350,15 +12350,15 @@ endif
endif


BM_CHTTP2_SRC = \
test/cpp/microbenchmarks/bm_chttp2.cc \
BM_CHTTP2_HPACK_SRC = \
test/cpp/microbenchmarks/bm_chttp2_hpack.cc \

BM_CHTTP2_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_CHTTP2_SRC))))
BM_CHTTP2_HPACK_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(BM_CHTTP2_HPACK_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/bm_chttp2: openssl_dep_error
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack: openssl_dep_error

else

Expand All @@ -12369,26 +12369,26 @@ ifeq ($(NO_PROTOBUF),true)

# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.

$(BINDIR)/$(CONFIG)/bm_chttp2: protobuf_dep_error
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack: protobuf_dep_error

else

$(BINDIR)/$(CONFIG)/bm_chttp2: $(PROTOBUF_DEP) $(BM_CHTTP2_OBJS) $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(BINDIR)/$(CONFIG)/bm_chttp2_hpack: $(PROTOBUF_DEP) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_OBJS) $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2
$(Q) $(LDXX) $(LDFLAGS) $(BM_CHTTP2_HPACK_OBJS) $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/bm_chttp2_hpack

endif

endif

$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2.o: $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(OBJDIR)/$(CONFIG)/test/cpp/microbenchmarks/bm_chttp2_hpack.o: $(LIBDIR)/$(CONFIG)/libbenchmark.a $(LIBDIR)/$(CONFIG)/libgrpc++_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a

deps_bm_chttp2: $(BM_CHTTP2_OBJS:.o=.dep)
deps_bm_chttp2_hpack: $(BM_CHTTP2_HPACK_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(BM_CHTTP2_OBJS:.o=.dep)
-include $(BM_CHTTP2_HPACK_OBJS:.o=.dep)
endif
endif

Expand Down
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2980,11 +2980,11 @@ targets:
- mac
- linux
- posix
- name: bm_chttp2
- name: bm_chttp2_hpack
build: test
language: c++
src:
- test/cpp/microbenchmarks/bm_chttp2.cc
- test/cpp/microbenchmarks/bm_chttp2_hpack.cc
deps:
- benchmark
- grpc++_test_util
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
*/

/* Microbenchmarks around CHTTP2 operations */
/* Microbenchmarks around CHTTP2 HPACK operations */

#include <grpc/support/log.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion third_party/gflags
4 changes: 2 additions & 2 deletions tools/run_tests/generated/sources_and_headers.json
Original file line number Diff line number Diff line change
Expand Up @@ -2345,9 +2345,9 @@
"headers": [],
"is_filegroup": false,
"language": "c++",
"name": "bm_chttp2",
"name": "bm_chttp2_hpack",
"src": [
"test/cpp/microbenchmarks/bm_chttp2.cc"
"test/cpp/microbenchmarks/bm_chttp2_hpack.cc"
],
"third_party": false,
"type": "target"
Expand Down
2 changes: 1 addition & 1 deletion tools/run_tests/generated/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -2484,7 +2484,7 @@
"flaky": false,
"gtest": false,
"language": "c++",
"name": "bm_chttp2",
"name": "bm_chttp2_hpack",
"platforms": [
"linux",
"mac",
Expand Down
7 changes: 6 additions & 1 deletion tools/run_tests/run_microbenchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ def collect_summary(bm_name, args):
default=sorted(collectors.keys()),
help='Which collectors should be run against each benchmark')
argp.add_argument('-b', '--benchmarks',
default=['bm_fullstack', 'bm_closure', 'bm_cq', 'bm_call_create', 'bm_error'],
default=['bm_fullstack',
'bm_closure',
'bm_cq',
'bm_call_create',
'bm_error',
'bm_chttp2_hpack'],
nargs='+',
type=str,
help='Which microbenchmarks should be run')
Expand Down

0 comments on commit 523d54b

Please sign in to comment.