BUILD 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. # Copyright 2017 gRPC authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
  15. load("//test/cpp/microbenchmarks:grpc_benchmark_config.bzl", "grpc_benchmark_args")
  16. licenses(["notice"])
  17. grpc_package(name = "test/cpp/microbenchmarks")
  18. grpc_cc_test(
  19. name = "noop-benchmark",
  20. srcs = ["noop-benchmark.cc"],
  21. external_deps = [
  22. "benchmark",
  23. ],
  24. deps = ["//test/core/util:grpc_test_util"],
  25. )
  26. grpc_cc_library(
  27. name = "helpers",
  28. testonly = 1,
  29. srcs = ["helpers.cc"],
  30. hdrs = [
  31. "fullstack_context_mutators.h",
  32. "fullstack_fixtures.h",
  33. "helpers.h",
  34. ],
  35. external_deps = [
  36. "benchmark",
  37. ],
  38. deps = [
  39. "//:grpc++_unsecure",
  40. "//src/proto/grpc/testing:echo_proto",
  41. "//test/core/util:grpc_test_util_unsecure",
  42. "//test/cpp/util:test_config",
  43. ],
  44. )
  45. # Need a secure version of helpers to benchmark opencensus
  46. grpc_cc_library(
  47. name = "helpers_secure",
  48. testonly = 1,
  49. srcs = ["helpers.cc"],
  50. hdrs = [
  51. "fullstack_context_mutators.h",
  52. "fullstack_fixtures.h",
  53. "helpers.h",
  54. ],
  55. external_deps = [
  56. "benchmark",
  57. ],
  58. deps = [
  59. "//:grpc++",
  60. "//src/proto/grpc/testing:echo_proto",
  61. "//test/core/util:grpc_test_util",
  62. "//test/cpp/util:test_config",
  63. ],
  64. )
  65. grpc_cc_test(
  66. name = "bm_closure",
  67. srcs = ["bm_closure.cc"],
  68. args = grpc_benchmark_args(),
  69. tags = [
  70. "no_mac",
  71. "no_windows",
  72. ],
  73. deps = [":helpers"],
  74. )
  75. grpc_cc_test(
  76. name = "bm_alarm",
  77. srcs = ["bm_alarm.cc"],
  78. args = grpc_benchmark_args(),
  79. tags = [
  80. "no_mac",
  81. "no_windows",
  82. ],
  83. deps = [":helpers"],
  84. )
  85. grpc_cc_test(
  86. name = "bm_arena",
  87. size = "large",
  88. srcs = ["bm_arena.cc"],
  89. args = grpc_benchmark_args(),
  90. tags = [
  91. "no_mac",
  92. "no_windows",
  93. "notsan",
  94. ],
  95. uses_polling = False,
  96. deps = [":helpers"],
  97. )
  98. grpc_cc_test(
  99. name = "bm_byte_buffer",
  100. srcs = ["bm_byte_buffer.cc"],
  101. args = grpc_benchmark_args(),
  102. tags = [
  103. "no_mac",
  104. "no_windows",
  105. ],
  106. uses_polling = False,
  107. deps = [":helpers"],
  108. )
  109. grpc_cc_test(
  110. name = "bm_channel",
  111. srcs = ["bm_channel.cc"],
  112. args = grpc_benchmark_args(),
  113. tags = [
  114. "no_mac",
  115. "no_windows",
  116. ],
  117. uses_polling = False,
  118. deps = [":helpers"],
  119. )
  120. grpc_cc_test(
  121. name = "bm_call_create",
  122. srcs = ["bm_call_create.cc"],
  123. args = grpc_benchmark_args(),
  124. tags = [
  125. "no_mac",
  126. "no_windows",
  127. ],
  128. uses_polling = False,
  129. deps = [":helpers"],
  130. )
  131. grpc_cc_test(
  132. name = "bm_cq",
  133. srcs = ["bm_cq.cc"],
  134. args = grpc_benchmark_args(),
  135. tags = [
  136. "no_mac",
  137. "no_windows",
  138. ],
  139. deps = [":helpers"],
  140. )
  141. grpc_cc_test(
  142. name = "bm_cq_multiple_threads",
  143. srcs = ["bm_cq_multiple_threads.cc"],
  144. args = grpc_benchmark_args(),
  145. tags = [
  146. "no_mac",
  147. "no_windows",
  148. ],
  149. uses_polling = False,
  150. deps = [":helpers"],
  151. )
  152. grpc_cc_library(
  153. name = "fullstack_streaming_ping_pong_h",
  154. testonly = 1,
  155. hdrs = [
  156. "fullstack_streaming_ping_pong.h",
  157. ],
  158. tags = [
  159. "no_mac",
  160. "no_windows",
  161. ],
  162. deps = [":helpers"],
  163. )
  164. grpc_cc_test(
  165. name = "bm_fullstack_streaming_ping_pong",
  166. size = "large",
  167. srcs = [
  168. "bm_fullstack_streaming_ping_pong.cc",
  169. ],
  170. args = grpc_benchmark_args(),
  171. tags = [
  172. "no_mac", # to emulate "excluded_poll_engines: poll"
  173. "no_windows",
  174. ],
  175. deps = [":fullstack_streaming_ping_pong_h"],
  176. )
  177. grpc_cc_library(
  178. name = "fullstack_streaming_pump_h",
  179. testonly = 1,
  180. hdrs = [
  181. "fullstack_streaming_pump.h",
  182. ],
  183. deps = [":helpers"],
  184. )
  185. grpc_cc_test(
  186. name = "bm_fullstack_streaming_pump",
  187. srcs = [
  188. "bm_fullstack_streaming_pump.cc",
  189. ],
  190. args = grpc_benchmark_args(),
  191. tags = [
  192. "no_mac", # to emulate "excluded_poll_engines: poll"
  193. "no_windows",
  194. ],
  195. deps = [":fullstack_streaming_pump_h"],
  196. )
  197. grpc_cc_library(
  198. name = "fullstack_unary_ping_pong_h",
  199. testonly = 1,
  200. hdrs = [
  201. "fullstack_unary_ping_pong.h",
  202. ],
  203. deps = [":helpers"],
  204. )
  205. grpc_cc_test(
  206. name = "bm_fullstack_unary_ping_pong",
  207. size = "large",
  208. srcs = [
  209. "bm_fullstack_unary_ping_pong.cc",
  210. ],
  211. args = grpc_benchmark_args(),
  212. tags = [
  213. "no_mac", # to emulate "excluded_poll_engines: poll"
  214. "no_windows",
  215. ],
  216. deps = [":fullstack_unary_ping_pong_h"],
  217. )
  218. grpc_cc_test(
  219. name = "bm_chttp2_hpack",
  220. srcs = ["bm_chttp2_hpack.cc"],
  221. args = grpc_benchmark_args(),
  222. tags = [
  223. "no_mac",
  224. "no_windows",
  225. ],
  226. uses_polling = False,
  227. deps = [":helpers"],
  228. )
  229. grpc_cc_test(
  230. name = "bm_chttp2_transport",
  231. srcs = ["bm_chttp2_transport.cc"],
  232. args = grpc_benchmark_args(),
  233. tags = [
  234. "no_mac",
  235. "no_windows",
  236. "nomsan",
  237. ],
  238. deps = [":helpers"],
  239. )
  240. grpc_cc_test(
  241. name = "bm_opencensus_plugin",
  242. srcs = ["bm_opencensus_plugin.cc"],
  243. args = grpc_benchmark_args(),
  244. language = "C++",
  245. deps = [
  246. ":helpers_secure",
  247. "//:grpc_opencensus_plugin",
  248. "//src/proto/grpc/testing:echo_proto",
  249. ],
  250. )
  251. grpc_cc_test(
  252. name = "bm_pollset",
  253. srcs = ["bm_pollset.cc"],
  254. args = grpc_benchmark_args(),
  255. tags = [
  256. "no_mac",
  257. "no_windows",
  258. ],
  259. deps = [":helpers"],
  260. )
  261. grpc_cc_test(
  262. name = "bm_threadpool",
  263. size = "large",
  264. srcs = ["bm_threadpool.cc"],
  265. args = grpc_benchmark_args(),
  266. tags = [
  267. "manual",
  268. "no_windows",
  269. "notap",
  270. ],
  271. uses_polling = False,
  272. deps = [":helpers"],
  273. )
  274. grpc_cc_library(
  275. name = "bm_callback_test_service_impl",
  276. testonly = 1,
  277. srcs = ["callback_test_service.cc"],
  278. hdrs = ["callback_test_service.h"],
  279. external_deps = [
  280. "benchmark",
  281. ],
  282. deps = [
  283. ":helpers",
  284. "//src/proto/grpc/testing:echo_proto",
  285. "//test/cpp/util:test_util_unsecure",
  286. ],
  287. )
  288. grpc_cc_library(
  289. name = "callback_unary_ping_pong_h",
  290. testonly = 1,
  291. hdrs = [
  292. "callback_unary_ping_pong.h",
  293. ],
  294. deps = [
  295. ":bm_callback_test_service_impl",
  296. ":helpers",
  297. ],
  298. )
  299. grpc_cc_test(
  300. name = "bm_callback_unary_ping_pong",
  301. size = "large",
  302. srcs = [
  303. "bm_callback_unary_ping_pong.cc",
  304. ],
  305. args = grpc_benchmark_args(),
  306. tags = [
  307. "manual",
  308. "no_mac",
  309. "no_windows",
  310. "notap",
  311. ],
  312. deps = [":callback_unary_ping_pong_h"],
  313. )
  314. grpc_cc_library(
  315. name = "callback_streaming_ping_pong_h",
  316. testonly = 1,
  317. hdrs = [
  318. "callback_streaming_ping_pong.h",
  319. ],
  320. deps = [
  321. ":bm_callback_test_service_impl",
  322. ":helpers",
  323. ],
  324. )
  325. grpc_cc_test(
  326. name = "bm_callback_streaming_ping_pong",
  327. size = "large",
  328. srcs = [
  329. "bm_callback_streaming_ping_pong.cc",
  330. ],
  331. args = grpc_benchmark_args(),
  332. tags = [
  333. "manual",
  334. "no_mac",
  335. "no_windows",
  336. "notap",
  337. ],
  338. deps = [":callback_streaming_ping_pong_h"],
  339. )