Debian Codegraph @

test/cpp/microbenchmarks/BUILD

raw
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
15 load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
16 load("//test/cpp/microbenchmarks:grpc_benchmark_config.bzl", "grpc_benchmark_args")
17
18 licenses(["notice"])
19
20 grpc_package(name = "test/cpp/microbenchmarks")
21
22 grpc_cc_test(
23 name = "noop-benchmark",
24 srcs = ["noop-benchmark.cc"],
25 external_deps = [
26 "benchmark",
27 ],
28 deps = ["//test/core/util:grpc_test_util"],
29 )
30
31 grpc_cc_test(
32 name = "bm_channel_args",
33 srcs = ["bm_channel_args.cc"],
34 external_deps = [
35 "benchmark",
36 "absl/container:btree",
37 ],
38 deps = [
39 "//:grpc++",
40 "//src/core:channel_args",
41 "//test/core/util:grpc_test_util",
42 ],
43 )
44
45 grpc_cc_test(
46 name = "bm_exec_ctx",
47 srcs = ["bm_exec_ctx.cc"],
48 args = grpc_benchmark_args(),
49 external_deps = [
50 "benchmark",
51 ],
52 uses_event_engine = False,
53 uses_polling = False,
54 deps = [":helpers"],
55 )
56
57 grpc_cc_test(
58 name = "bm_event_engine_run",
59 size = "small",
60 srcs = ["bm_event_engine_run.cc"],
61 args = grpc_benchmark_args(),
62 external_deps = [
63 "absl/debugging:leak_check",
64 "benchmark",
65 ],
66 uses_polling = False,
67 deps = [
68 ":helpers",
69 "//src/core:common_event_engine_closures",
70 ],
71 )
72
73 grpc_cc_test(
74 name = "bm_thread_pool",
75 size = "small",
76 srcs = ["bm_thread_pool.cc"],
77 args = grpc_benchmark_args(),
78 external_deps = [
79 "benchmark",
80 ],
81 uses_event_engine = False,
82 uses_polling = False,
83 deps = [
84 ":helpers",
85 "//src/core:common_event_engine_closures",
86 ],
87 )
88
89 grpc_cc_library(
90 name = "helpers",
91 testonly = 1,
92 srcs = ["helpers.cc"],
93 hdrs = [
94 "fullstack_context_mutators.h",
95 "fullstack_fixtures.h",
96 "helpers.h",
97 ],
98 external_deps = [
99 "benchmark",
100 ],
101 deps = [
102 "//:grpc++_unsecure",
103 "//src/proto/grpc/testing:echo_proto",
104 "//test/core/util:grpc_test_util_base",
105 "//test/core/util:grpc_test_util_unsecure",
106 "//test/cpp/util:test_config",
107 ],
108 )
109
110 # Need a secure version of helpers to benchmark opencensus
111 grpc_cc_library(
112 name = "helpers_secure",
113 testonly = 1,
114 srcs = ["helpers.cc"],
115 hdrs = [
116 "fullstack_context_mutators.h",
117 "fullstack_fixtures.h",
118 "helpers.h",
119 ],
120 external_deps = [
121 "benchmark",
122 ],
123 deps = [
124 "//:grpc++",
125 "//src/proto/grpc/testing:echo_proto",
126 "//test/core/util:grpc_test_util",
127 "//test/core/util:grpc_test_util_base",
128 "//test/cpp/util:test_config",
129 ],
130 )
131
132 grpc_cc_test(
133 name = "bm_closure",
134 srcs = ["bm_closure.cc"],
135 args = grpc_benchmark_args(),
136 tags = [
137 "no_mac",
138 "no_windows",
139 ],
140 deps = [":helpers"],
141 )
142
143 grpc_cc_test(
144 name = "bm_huffman_decode",
145 srcs = ["bm_huffman_decode.cc"],
146 args = grpc_benchmark_args(),
147 tags = [
148 "no_mac",
149 "no_windows",
150 ],
151 deps = [":helpers"],
152 )
153
154 grpc_cc_test(
155 name = "bm_alarm",
156 srcs = ["bm_alarm.cc"],
157 args = grpc_benchmark_args(),
158 tags = [
159 "no_mac",
160 "no_windows",
161 ],
162 deps = [":helpers"],
163 )
164
165 grpc_cc_test(
166 name = "bm_arena",
167 size = "large",
168 srcs = ["bm_arena.cc"],
169 args = grpc_benchmark_args(),
170 tags = [
171 "no_mac",
172 "no_windows",
173 "notsan",
174 ],
175 uses_event_engine = False,
176 uses_polling = False,
177 deps = [":helpers"],
178 )
179
180 grpc_cc_test(
181 name = "bm_byte_buffer",
182 srcs = ["bm_byte_buffer.cc"],
183 args = grpc_benchmark_args(),
184 tags = [
185 "no_mac",
186 "no_windows",
187 ],
188 uses_event_engine = False,
189 uses_polling = False,
190 deps = [":helpers"],
191 )
192
193 grpc_cc_test(
194 name = "bm_channel",
195 srcs = ["bm_channel.cc"],
196 args = grpc_benchmark_args(),
197 tags = [
198 "no_mac",
199 "no_windows",
200 ],
201 uses_event_engine = False,
202 uses_polling = False,
203 deps = [":helpers"],
204 )
205
206 grpc_cc_test(
207 name = "bm_call_create",
208 srcs = ["bm_call_create.cc"],
209 args = grpc_benchmark_args(),
210 tags = [
211 "no_mac",
212 "no_windows",
213 ],
214 uses_event_engine = False,
215 uses_polling = False,
216 deps = [":helpers"],
217 )
218
219 grpc_cc_test(
220 name = "bm_cq",
221 srcs = ["bm_cq.cc"],
222 args = grpc_benchmark_args(),
223 tags = [
224 "no_mac",
225 "no_windows",
226 ],
227 deps = [":helpers"],
228 )
229
230 grpc_cc_test(
231 name = "bm_cq_multiple_threads",
232 srcs = ["bm_cq_multiple_threads.cc"],
233 args = grpc_benchmark_args(),
234 tags = [
235 "no_mac",
236 "no_windows",
237 ],
238 uses_event_engine = False,
239 uses_polling = False,
240 deps = [":helpers"],
241 )
242
243 grpc_cc_library(
244 name = "fullstack_streaming_ping_pong_h",
245 testonly = 1,
246 hdrs = [
247 "fullstack_streaming_ping_pong.h",
248 ],
249 tags = [
250 "no_mac",
251 "no_windows",
252 ],
253 deps = [":helpers"],
254 )
255
256 grpc_cc_test(
257 name = "bm_fullstack_streaming_ping_pong",
258 size = "large",
259 srcs = [
260 "bm_fullstack_streaming_ping_pong.cc",
261 ],
262 args = grpc_benchmark_args(),
263 flaky = True,
264 tags = [
265 "no_mac", # to emulate "excluded_poll_engines: poll"
266 "no_windows",
267 ],
268 deps = [":fullstack_streaming_ping_pong_h"],
269 )
270
271 grpc_cc_library(
272 name = "fullstack_streaming_pump_h",
273 testonly = 1,
274 hdrs = [
275 "fullstack_streaming_pump.h",
276 ],
277 deps = [":helpers"],
278 )
279
280 grpc_cc_test(
281 name = "bm_fullstack_streaming_pump",
282 srcs = [
283 "bm_fullstack_streaming_pump.cc",
284 ],
285 args = grpc_benchmark_args(),
286 tags = [
287 "no_mac", # to emulate "excluded_poll_engines: poll"
288 "no_windows",
289 ],
290 deps = [":fullstack_streaming_pump_h"],
291 )
292
293 grpc_cc_library(
294 name = "fullstack_unary_ping_pong_h",
295 testonly = 1,
296 hdrs = [
297 "fullstack_unary_ping_pong.h",
298 ],
299 deps = [":helpers"],
300 )
301
302 grpc_cc_test(
303 name = "bm_fullstack_unary_ping_pong",
304 size = "large",
305 srcs = [
306 "bm_fullstack_unary_ping_pong.cc",
307 ],
308 args = grpc_benchmark_args(),
309 tags = [
310 "no_mac", # to emulate "excluded_poll_engines: poll"
311 "no_windows",
312 ],
313 deps = [":fullstack_unary_ping_pong_h"],
314 )
315
316 grpc_cc_test(
317 name = "bm_chttp2_hpack",
318 srcs = ["bm_chttp2_hpack.cc"],
319 args = grpc_benchmark_args(),
320 tags = [
321 "no_mac",
322 "no_windows",
323 ],
324 uses_event_engine = False,
325 uses_polling = False,
326 deps = [":helpers"],
327 )
328
329 grpc_cc_test(
330 name = "bm_chttp2_transport",
331 srcs = ["bm_chttp2_transport.cc"],
332 args = grpc_benchmark_args(),
333 tags = [
334 "no_mac",
335 "no_windows",
336 "nomsan",
337 ],
338 deps = [":helpers"],
339 )
340
341 grpc_cc_test(
342 name = "bm_opencensus_plugin",
343 srcs = ["bm_opencensus_plugin.cc"],
344 args = grpc_benchmark_args(),
345 language = "C++",
346 deps = [
347 ":helpers_secure",
348 "//:grpc_opencensus_plugin",
349 "//src/proto/grpc/testing:echo_proto",
350 ],
351 )
352
353 grpc_cc_test(
354 name = "bm_pollset",
355 srcs = ["bm_pollset.cc"],
356 args = grpc_benchmark_args(),
357 tags = [
358 "no_mac",
359 "no_windows",
360 ],
361 deps = [
362 ":helpers",
363 ],
364 )
365
366 grpc_cc_library(
367 name = "bm_callback_test_service_impl",
368 testonly = 1,
369 srcs = ["callback_test_service.cc"],
370 hdrs = ["callback_test_service.h"],
371 external_deps = [
372 "benchmark",
373 ],
374 deps = [
375 ":helpers",
376 "//src/proto/grpc/testing:echo_proto",
377 "//test/cpp/util:test_util_unsecure",
378 ],
379 )
380
381 grpc_cc_library(
382 name = "callback_unary_ping_pong_h",
383 testonly = 1,
384 hdrs = [
385 "callback_unary_ping_pong.h",
386 ],
387 deps = [
388 ":bm_callback_test_service_impl",
389 ":helpers",
390 ],
391 )
392
393 grpc_cc_test(
394 name = "bm_callback_unary_ping_pong",
395 size = "large",
396 srcs = [
397 "bm_callback_unary_ping_pong.cc",
398 ],
399 args = grpc_benchmark_args(),
400 tags = [
401 "manual",
402 "no_mac",
403 "no_windows",
404 "notap",
405 ],
406 deps = [":callback_unary_ping_pong_h"],
407 )
408
409 grpc_cc_library(
410 name = "callback_streaming_ping_pong_h",
411 testonly = 1,
412 hdrs = [
413 "callback_streaming_ping_pong.h",
414 ],
415 deps = [
416 ":bm_callback_test_service_impl",
417 ":helpers",
418 ],
419 )
420
421 grpc_cc_test(
422 name = "bm_callback_streaming_ping_pong",
423 size = "large",
424 srcs = [
425 "bm_callback_streaming_ping_pong.cc",
426 ],
427 args = grpc_benchmark_args(),
428 tags = [
429 "manual",
430 "no_mac",
431 "no_windows",
432 "notap",
433 ],
434 deps = [":callback_streaming_ping_pong_h"],
435 )
436
437 grpc_cc_test(
438 name = "bm_work_queue",
439 srcs = ["bm_work_queue.cc"],
440 args = grpc_benchmark_args(),
441 external_deps = ["benchmark"],
442 tags = [
443 "manual",
444 "no_windows",
445 "notap",
446 ],
447 uses_event_engine = False,
448 uses_polling = False,
449 deps = [
450 "//:gpr",
451 "//src/core:common_event_engine_closures",
452 "//src/core:event_engine_work_queue",
453 "//test/core/util:grpc_test_util",
454 ],
455 )