├── .bazelversion ├── .gitignore ├── fleetbench ├── simd │ ├── tensorflow_support │ │ ├── WORKSPACE │ │ ├── MODULE.bazel │ │ ├── BUILD.bazel │ │ └── tensorflow │ │ │ └── core │ │ │ └── lib │ │ │ └── core │ │ │ └── threadpool.h │ └── BUILD ├── hashing │ ├── distributions │ │ ├── Computecrc32c_1.csv │ │ ├── Extendcrc32cinternal_3.csv │ │ ├── README.md │ │ ├── Computecrc32c_2.csv │ │ ├── Extendcrc32cinternal_1.csv │ │ ├── Extendcrc32cinternal_0.csv │ │ ├── Computecrc32c_0.csv │ │ ├── Combine_contiguous_2.csv │ │ ├── Combine_contiguous_1.csv │ │ ├── Extendcrc32cinternal_4.csv │ │ ├── Extendcrc32cinternal_2.csv │ │ ├── Computecrc32c_Fleet.csv │ │ └── Combine_contiguous_3.csv │ └── BUILD ├── .clang-format ├── tcmalloc │ └── distributions │ │ └── heap_size.csv ├── compression │ ├── generate_corpora │ │ ├── corpora │ │ │ ├── fireworks.jpeg │ │ │ ├── geo.protodata │ │ │ ├── paper-100k.pdf │ │ │ ├── baddata1.snappy │ │ │ ├── baddata2.snappy │ │ │ └── baddata3.snappy │ │ └── BUILD │ ├── compression_parameters │ │ └── compression_level_external.csv │ ├── zstd.BUILD │ └── compression_parameter.h ├── libc │ ├── distributions │ │ ├── Memset_7.csv │ │ ├── Memcmp_4.csv │ │ ├── Memcmp_7.csv │ │ ├── Bcmp_7.csv │ │ ├── Memcmp_5.csv │ │ ├── README.md │ │ ├── Bcmp_4.csv │ │ ├── Memcmp_2.csv │ │ ├── Bcmp_5.csv │ │ ├── Memset_4.csv │ │ ├── Memcmp_8.csv │ │ ├── Memmove_7.csv │ │ ├── Bcmp_0.csv │ │ ├── Memcpy_7.csv │ │ ├── Memcmp_0.csv │ │ ├── Memset_0.csv │ │ ├── Bcmp_8.csv │ │ ├── Bcmp_2.csv │ │ └── Memset_1.csv │ ├── utils.cc │ └── BUILD ├── utils.bzl ├── rpc │ ├── protos │ │ ├── P1 │ │ │ ├── response │ │ │ │ ├── Message2.proto │ │ │ │ └── access_message2.h │ │ │ └── request │ │ │ │ ├── Message2.proto │ │ │ │ └── Message1.proto │ │ ├── P3 │ │ │ └── response │ │ │ │ ├── Message0.proto │ │ │ │ ├── Message2.proto │ │ │ │ └── access_message0.h │ │ ├── P9 │ │ │ ├── response │ │ │ │ ├── Message2.proto │ │ │ │ ├── Message1.proto │ │ │ │ └── access_message2.h │ │ │ └── request │ │ │ │ └── Message1.proto │ │ ├── P0 │ │ │ ├── response │ │ │ │ └── Message2.proto │ │ │ └── request │ │ │ │ └── Message2.proto │ │ ├── P4 │ │ │ ├── response │ │ │ │ ├── Message0.proto │ │ │ │ ├── Message1.proto │ │ │ │ └── Message2.proto │ │ │ └── request │ │ │ │ └── Message1.proto │ │ ├── P6 │ │ │ ├── response │ │ │ │ ├── Message1.proto │ │ │ │ └── Message2.proto │ │ │ └── request │ │ │ │ ├── Message0.proto │ │ │ │ └── Message2.proto │ │ ├── P8 │ │ │ └── response │ │ │ │ └── Message0.proto │ │ ├── P2 │ │ │ └── response │ │ │ │ └── Message2.proto │ │ ├── P10 │ │ │ ├── response │ │ │ │ └── Message2.proto │ │ │ └── request │ │ │ │ ├── Message2.proto │ │ │ │ ├── Message1.proto │ │ │ │ └── access_message1.h │ │ ├── P7 │ │ │ └── request │ │ │ │ └── Message1.proto │ │ ├── P0RequestMessage.proto │ │ ├── P1RequestMessage.proto │ │ ├── P2RequestMessage.proto │ │ ├── P3RequestMessage.proto │ │ ├── P4RequestMessage.proto │ │ ├── P5RequestMessage.proto │ │ ├── P6RequestMessage.proto │ │ ├── P7RequestMessage.proto │ │ ├── P8RequestMessage.proto │ │ ├── P9RequestMessage.proto │ │ ├── P0ResponseMessage.proto │ │ ├── P10RequestMessage.proto │ │ ├── P1ResponseMessage.proto │ │ ├── P2ResponseMessage.proto │ │ ├── P3ResponseMessage.proto │ │ ├── P4ResponseMessage.proto │ │ ├── P5ResponseMessage.proto │ │ ├── P6ResponseMessage.proto │ │ ├── P7ResponseMessage.proto │ │ ├── P8ResponseMessage.proto │ │ ├── P9ResponseMessage.proto │ │ ├── P10ResponseMessage.proto │ │ ├── RequestMessage.proto │ │ ├── ResponseMessage.proto │ │ ├── P0RequestMessage.h │ │ ├── P1RequestMessage.h │ │ ├── P2RequestMessage.h │ │ ├── P3RequestMessage.h │ │ ├── P4RequestMessage.h │ │ ├── P5RequestMessage.h │ │ ├── P6RequestMessage.h │ │ ├── P7RequestMessage.h │ │ ├── P8RequestMessage.h │ │ ├── P9RequestMessage.h │ │ ├── P0ResponseMessage.h │ │ ├── P10RequestMessage.h │ │ ├── P1ResponseMessage.h │ │ ├── P2ResponseMessage.h │ │ ├── P3ResponseMessage.h │ │ ├── P4ResponseMessage.h │ │ ├── P5ResponseMessage.h │ │ ├── P6ResponseMessage.h │ │ ├── P7ResponseMessage.h │ │ ├── P8ResponseMessage.h │ │ └── P9ResponseMessage.h │ ├── fleetbenchservice.proto │ ├── distributionargs.proto │ ├── rpc_counters.h │ ├── util.h │ ├── rpcperf.h │ └── rpc_counters.cc ├── llvmlibc.BUILD.bazel ├── stl │ ├── BUILD │ └── cord_benchmark.cc ├── patches │ ├── BUILD.bazel │ ├── 0001-Remove-more_deps-argument.patch │ ├── 0003-Replace-non-standard-uint32-with-uint32_t.patch │ ├── 0002-Replace-gtest_main-with-gtest.patch │ └── 0005-Update-path-to-py_proto_library.patch ├── common │ └── BUILD ├── llvm_project.bzl ├── requirements.in ├── parallel │ ├── result.py │ ├── weights.csv │ └── worker_test.py ├── libnuma.BUILD.bazel ├── productivity_reporter.cc ├── productivity_reporter.h ├── proto │ └── benchmark_test.cc ├── distro_test.py ├── tcmalloc_copts.bzl ├── swissmap │ ├── swissmap_benchmark_test.cc │ └── BUILD └── dynamic_registrar.cc ├── CONTRIBUTING.md ├── .bazelignore ├── .github └── workflows │ ├── update.yml │ └── ci.yaml └── ci └── linux_gcc-latest_libstdcxx_bazel.sh /.bazelversion: -------------------------------------------------------------------------------- 1 | 8.0.0 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Bazel 2 | bazel-* -------------------------------------------------------------------------------- /fleetbench/simd/tensorflow_support/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "local_config_tf") 2 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Computecrc32c_1.csv: -------------------------------------------------------------------------------- 1 | 8:0.167742,44:0.00645161,48:0.806452,50:0.00645161,51:0.00645161,55:0.00645161 2 | -------------------------------------------------------------------------------- /fleetbench/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | DerivePointerAlignment: false 5 | PointerAlignment: Left 6 | ... 7 | -------------------------------------------------------------------------------- /fleetbench/tcmalloc/distributions/heap_size.csv: -------------------------------------------------------------------------------- 1 | 0,29615 2 | 1,93 3 | 2,11967 4 | 3,3536 5 | 4,1150 6 | 5,616 7 | 6,6811 8 | 7,63015 9 | 8,8797 10 | 9,15472 -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/fireworks.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/fireworks.jpeg -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/geo.protodata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/geo.protodata -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/paper-100k.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/paper-100k.pdf -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/baddata1.snappy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/baddata1.snappy -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/baddata2.snappy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/baddata2.snappy -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/corpora/baddata3.snappy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/google/fleetbench/HEAD/fleetbench/compression/generate_corpora/corpora/baddata3.snappy -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | At this stage we are not accepting patches and contributions to this project. 4 | Please open an Issue for support or to discuss potential improvements. 5 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Extendcrc32cinternal_3.csv: -------------------------------------------------------------------------------- 1 | 104:0.015625,128:0.0078125,576:0.0078125,618:0.0078125,673:0.0078125,1022:0.015625,1661:0.0078125,2263:0.0078125,2398:0.0078125,4075:0.40625,4091:0.0234375,4155:0.484375 2 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/README.md: -------------------------------------------------------------------------------- 1 | The csv files in this directory contain the hashing size distributions. The 2 | files have a single line; the format of the entries is x:y, which means that 3 | size x occurs with probability y. All the probabilities in the line sum to 1. 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Computecrc32c_2.csv: -------------------------------------------------------------------------------- 1 | 0:0.0112882,6:0.000221337,8:0.000885347,10:0.886012,11:0.000442674,12:0.00199203,16:0.0267818,17:0.000885347,19:0.00464807,21:0.000221337,24:0.000221337,31:0.000664011,32:0.0568836,34:0.000442674,37:0.000221337,48:0.00796813,54:0.000221337 2 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memset_7.csv: -------------------------------------------------------------------------------- 1 | 6:0.12987,7:0.0519481,8:0.12987,9:0.038961,10:0.0779221,17:0.298701,19:0.0519481,21:0.012987,23:0.012987,24:0.012987,29:0.012987,31:0.012987,32:0.0519481,112:0.012987,143:0.038961,176:0.012987,232:0.012987,712:0.012987,4598:0.012987 2 | 0:1 3 | 8:0.428571,16:0.272727,32:0.155844,64:0.142857 4 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_4.csv: -------------------------------------------------------------------------------- 1 | 0:0.000862069,4:0.075,5:0.000862069,8:0.00603448,11:0.000862069,14:0.00344828,15:0.0172414,16:0.00344828,17:0.712931,18:0.119828,19:0.0275862,25:0.0275862,45:0.000862069,77:0.000862069,82:0.000862069,94:0.000862069,129:0.000862069 2 | 0:1 3 | 1:0.0827586,2:0.0301724,4:0.0163793,8:0.378448,16:0.188793,32:0.118966,64:0.184483 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Extendcrc32cinternal_1.csv: -------------------------------------------------------------------------------- 1 | 123:0.0454545,146:0.0181818,150:0.0181818,152:0.00909091,180:0.0181818,186:0.00909091,225:0.00909091,246:0.00909091,254:0.00909091,620:0.00909091,880:0.00909091,990:0.00909091,1154:0.00909091,2182:0.00909091,2317:0.00909091,2474:0.00909091,2564:0.00909091,2837:0.00909091,3472:0.00909091,3829:0.00909091,4027:0.181818,4155:0.572727 2 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Extendcrc32cinternal_0.csv: -------------------------------------------------------------------------------- 1 | 106:0.0011919,129:0.0011919,418:0.0011919,512:0.0011919,865:0.0011919,871:0.0011919,880:0.0011919,1199:0.0011919,1204:0.0011919,1319:0.0011919,1324:0.0011919,1344:0.0011919,1730:0.0011919,2150:0.0011919,2218:0.0011919,2936:0.0011919,2947:0.0011919,3067:0.0011919,3237:0.0011919,3250:0.0011919,4075:0.0011919,4091:0.0011919,4155:0.973778 2 | -------------------------------------------------------------------------------- /fleetbench/compression/compression_parameters/compression_level_external.csv: -------------------------------------------------------------------------------- 1 | Brotli,Fleet,1,2,3,4,5,6,7,8,9,11 2 | Brotli,0,4,5 3 | Brotli,1,5,6 4 | Brotli,2,6 5 | Flate,Fleet,1,3,4,5,6,7,8,9 6 | ZSTD,Fleet,-7,-5,-3,-2,-1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,20,22 7 | ZSTD,0,-1,1,2,3,4,5 8 | ZSTD,1,-5,-3,-1,1,2,3,4,6,7,8,9,11,14 9 | ZSTD,2,-5,-3,-1,1,2,3,4,6,7,8,9,11,14 10 | ZSTD,3,-1,3 11 | ZSTD,4,-1,1,3 12 | ZSTD,5,-1,1,3 13 | ZSTD,6,-1,1,2,3,4,12 14 | ZSTD,7,-2,-1,1,2,3,4 15 | ZSTD,8,3,10 16 | ZSTD,9,-1,1,2,3,4,5,7 17 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_7.csv: -------------------------------------------------------------------------------- 1 | 2:0.0212766,3:0.0106383,4:0.00531915,5:0.0106383,6:0.0319149,7:0.0265957,8:0.0478723,9:0.0691489,10:0.0319149,11:0.106383,12:0.0478723,13:0.0957447,14:0.0478723,15:0.0797872,16:0.0797872,17:0.0265957,18:0.0265957,19:0.0531915,20:0.0212766,21:0.0212766,22:0.0106383,23:0.0159574,24:0.0106383,25:0.0106383,26:0.0159574,27:0.0159574,28:0.00531915,30:0.00531915,31:0.0106383,33:0.00531915,35:0.00531915,37:0.00531915,45:0.00531915,46:0.00531915,50:0.00531915,56:0.00531915 2 | 0:1 3 | 1:0.0106383,8:0.319149,16:0.297872,32:0.180851,64:0.191489 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Computecrc32c_0.csv: -------------------------------------------------------------------------------- 1 | 0:0.0757576,1:0.00378788,2:0.00757576,5:0.00757576,8:0.265152,12:0.0189394,13:0.00378788,14:0.030303,16:0.0189394,17:0.00378788,18:0.00378788,19:0.0189394,20:0.0340909,22:0.0151515,23:0.00378788,24:0.00757576,25:0.00378788,26:0.00378788,27:0.00378788,28:0.00757576,31:0.0113636,32:0.0606061,33:0.00757576,34:0.00378788,36:0.0113636,37:0.00757576,39:0.00757576,40:0.00378788,42:0.00378788,43:0.00378788,45:0.0151515,46:0.0265152,47:0.00757576,48:0.261364,49:0.00378788,50:0.0113636,51:0.00378788,54:0.00378788,57:0.00378788,60:0.00378788 2 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_7.csv: -------------------------------------------------------------------------------- 1 | 1:0.00182482,2:0.0748175,3:0.00364964,4:0.00912409,5:0.00912409,7:0.00547445,8:0.00182482,9:0.0164234,10:0.0237226,11:0.00364964,12:0.594891,13:0.00547445,15:0.00547445,17:0.00547445,18:0.00182482,19:0.00364964,20:0.00182482,21:0.136861,22:0.0419708,23:0.00182482,25:0.00912409,27:0.00182482,28:0.00364964,31:0.00182482,32:0.00912409,34:0.00364964,35:0.00547445,36:0.00182482,37:0.00182482,41:0.00182482,50:0.00364964,74:0.00182482,80:0.00182482,91:0.00182482,99:0.00182482 2 | 0:0.998175,1:0.00182482 3 | 1:0.333942,2:0.0310219,4:0.45438,8:0.0985401,16:0.0218978,32:0.0218978,64:0.0383212 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Combine_contiguous_2.csv: -------------------------------------------------------------------------------- 1 | 0:0.00263678,2:0.0266315,4:0.0156889,5:0.0383652,6:0.0529993,7:0.0284773,8:0.0904417,9:0.00197759,10:0.295452,11:0.0189848,12:0.000263678,13:0.00355966,14:0.000263678,15:0.000791035,16:0.000659196,17:0.000659196,18:0.00145023,19:0.000659196,20:0.000791035,21:0.00184575,22:0.00487805,23:0.00158207,24:0.00276862,25:0.00131839,26:0.00184575,27:0.00474621,28:0.00382334,29:0.000131839,30:0.00487805,32:0.367304,33:0.000395517,35:0.000395517,36:0.000131839,37:0.000659196,38:0.000263678,39:0.000263678,40:0.019644,42:0.000395517,43:0.000263678,44:0.000131839,46:0.000131839,49:0.000527357,50:0.000263678,53:0.000131839,76:0.000527357 2 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_5.csv: -------------------------------------------------------------------------------- 1 | 1:0.0018438,2:0.0123798,3:0.0222573,4:0.0750691,5:0.0323983,6:0.0175161,7:0.212696,8:0.0530752,9:0.113657,10:0.126696,11:0.00974582,12:0.00974582,13:0.0151455,14:0.044383,15:0.138417,16:0.011853,17:0.0025023,18:0.0022389,19:0.00263401,20:0.0824444,21:0.000263401,22:0.0010536,23:0.00500461,24:0.0001317,25:0.0010536,26:0.000658501,27:0.000395101,28:0.0001317,29:0.000263401,30:0.000395101,32:0.0001317,33:0.000658501,34:0.000658501,35:0.0001317,36:0.000658501,37:0.000395101,38:0.000263401,41:0.000263401,44:0.0001317,52:0.0001317,289:0.0001317,293:0.000263401,297:0.0001317 2 | 0:0.937179,1:0.062821 3 | 1:0.315817,2:0.339655,4:0.0302911,8:0.195311,16:0.0375346,32:0.0333202,64:0.0480706 4 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/README.md: -------------------------------------------------------------------------------- 1 | The csv files in this directory have the following structure. 2 | 3 | The first line always contains the size distribution, the second line the 4 | overlap probability, and the third line the alignments. 5 | 6 | The format of the entries is x:y, which means that x occurs with probability y. 7 | For example, in the second line, "0:0.990775,1:0.00922544" means that there is 8 | no overlap (0) with probability 0.990775, and that there is overlap (1) with 9 | probability with 0.00922544. Note that for that particular line, one of the 10 | numbers is redundant, as they sum to one; implementing it this way made parsing 11 | easier as it is consistent with the other two lines. 12 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Combine_contiguous_1.csv: -------------------------------------------------------------------------------- 1 | 0:0.0622568,2:0.00389105,3:0.0505837,4:0.0116732,5:0.0233463,6:0.0350195,7:0.0389105,8:0.0583658,9:0.00389105,10:0.0272374,11:0.00389105,12:0.00389105,13:0.07393,14:0.0505837,16:0.0116732,18:0.00389105,20:0.0350195,21:0.0389105,22:0.0233463,23:0.00389105,24:0.0077821,25:0.00389105,27:0.0077821,28:0.0077821,29:0.0155642,32:0.0077821,33:0.00389105,34:0.0661479,36:0.00389105,39:0.0116732,42:0.00389105,44:0.00389105,47:0.00389105,48:0.00389105,50:0.00389105,58:0.00389105,60:0.00389105,79:0.00389105,99:0.00389105,100:0.0428016,114:0.00389105,115:0.0194553,136:0.0233463,143:0.0116732,144:0.0505837,150:0.00389105,153:0.0505837,157:0.0233463,159:0.0233463,164:0.00389105,183:0.00389105,267:0.00389105 2 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Extendcrc32cinternal_4.csv: -------------------------------------------------------------------------------- 1 | 67:0.00884956,83:0.00442478,91:0.00442478,99:0.00442478,107:0.00442478,131:0.00442478,179:0.00442478,243:0.00442478,291:0.00442478,307:0.00442478,339:0.00442478,358:0.00442478,386:0.00442478,626:0.00442478,691:0.00442478,754:0.00442478,2389:0.00442478,3019:0.00442478,3115:0.0353982,3276:0.00442478,3354:0.00442478,3458:0.00442478,3556:0.00442478,3612:0.00442478,3784:0.00442478,3979:0.00442478,4011:0.00442478,4027:0.00442478,4075:0.0619469,4139:0.00442478,4155:0.690265,4219:0.00442478,4371:0.00442478,4456:0.00442478,4544:0.00442478,4652:0.00442478,4688:0.00442478,4761:0.00442478,4913:0.00442478,5148:0.00442478,5168:0.00442478,5208:0.00442478,5395:0.00442478,6136:0.00442478,6556:0.00442478,6660:0.00442478,6898:0.00442478,7172:0.00442478,7399:0.00442478,7723:0.00442478 2 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Extendcrc32cinternal_2.csv: -------------------------------------------------------------------------------- 1 | 69:0.00315457,118:0.00315457,190:0.00315457,255:0.00315457,268:0.00315457,320:0.00315457,325:0.00315457,372:0.00315457,375:0.00315457,450:0.00315457,472:0.00315457,504:0.00315457,514:0.00315457,718:0.00315457,832:0.00315457,841:0.00315457,954:0.00315457,1018:0.00315457,1050:0.00315457,1062:0.00315457,1086:0.00315457,1094:0.00315457,1249:0.00315457,1284:0.00315457,1475:0.00315457,1863:0.00315457,1870:0.00315457,1990:0.00315457,2046:0.00315457,2174:0.00315457,2272:0.00315457,2290:0.00315457,2335:0.00315457,2344:0.00315457,2380:0.00315457,2434:0.00315457,2514:0.00315457,2604:0.00315457,2859:0.00315457,2947:0.00315457,3031:0.00315457,3103:0.00315457,3187:0.00315457,3263:0.00315457,3528:0.00315457,3640:0.00315457,3724:0.00315457,3769:0.00630915,3904:0.00315457,3979:0.00315457,4091:0.839117 2 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_4.csv: -------------------------------------------------------------------------------- 1 | 0:0.357763,1:0.0225008,2:0.0151077,3:0.00064288,4:0.00867888,5:0.123112,6:0.00096432,7:0.0469302,8:0.224687,9:0.0115718,10:0.00128576,11:0.00225008,12:0.00578592,13:0.0016072,14:0.0016072,15:0.00192864,16:0.0180006,17:0.0630023,18:0.0260366,19:0.00192864,20:0.00192864,21:0.0186435,22:0.0180006,23:0.00096432,24:0.00096432,25:0.00032144,26:0.00257152,27:0.00032144,28:0.00064288,29:0.00032144,30:0.00064288,31:0.00032144,32:0.00032144,34:0.00064288,35:0.00032144,36:0.00064288,38:0.00064288,39:0.00032144,40:0.00032144,42:0.00257152,43:0.00064288,51:0.00032144,60:0.00032144,79:0.00032144,82:0.00032144,114:0.00032144,122:0.0016072,132:0.00450016,141:0.0016072,149:0.00032144,173:0.00032144,181:0.00257152 2 | 0:0.999679,1:0.00032144 3 | 1:0.392157,2:0.018965,4:0.00867888,8:0.0678239,16:0.0507875,32:0.224687,64:0.236901 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Computecrc32c_Fleet.csv: -------------------------------------------------------------------------------- 1 | 0:0.00829466,1:0.00118495,2:0.000197492,5:0.000197492,6:9.87459e-05,7:9.87459e-05,8:0.0407821,10:0.39528,11:0.000197492,12:0.0047398,13:0.000296238,14:0.000789967,16:0.012442,17:0.000789967,18:9.87459e-05,19:0.00256739,20:0.000888713,21:9.87459e-05,22:0.00049373,23:9.87459e-05,24:0.00276489,25:9.87459e-05,26:9.87459e-05,27:0.000296238,28:0.000197492,31:0.000789967,32:0.0292288,33:0.000789967,34:0.00256739,35:0.0289326,36:0.0159968,37:0.00187617,38:0.0232053,39:0.043152,40:0.117409,41:0.149403,42:0.0528291,43:0.00898588,44:0.0100721,45:0.00246865,46:0.000789967,47:0.00049373,48:0.0243902,49:0.00049373,50:0.00138244,51:0.00167868,52:0.000394984,53:0.00049373,54:0.00118495,55:0.00108621,56:0.000592476,57:0.000789967,58:0.00108621,59:0.000789967,60:0.00049373,61:0.000987459,62:0.00138244,63:0.000394984,64:0.000296238 2 | -------------------------------------------------------------------------------- /fleetbench/utils.bzl: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2024 The Fleetbench Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License" ); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an " AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | def if_clang(a, otherwise = []): # buildifier: disable=unused-variable 18 | return select({ 19 | "@com_google_fleetbench//fleetbench:compiler_clang": a, 20 | "//conditions:default": otherwise, 21 | }) 22 | -------------------------------------------------------------------------------- /.bazelignore: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | # In bzlmod mode, bazel build ... will traverse into bazel-generated 16 | # subdirectories. This file lists sub-repos to exclude. 17 | # Previously, the presence of a WORKSPACE file would cause bazel to ignore it. 18 | 19 | fleetbench/simd/tensorflow_support -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P1.response.Message2; 19 | 20 | message Message2 { 21 | optional uint32 f_0 = 1; 22 | } 23 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3/response/Message0.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P3.response.Message0; 19 | 20 | message Message0 { 21 | optional int64 f_0 = 1; 22 | } 23 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P9.response.Message2; 19 | 20 | message Message2 { 21 | optional int64 f_0 = 1; 22 | } 23 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P0.response.Message2; 19 | 20 | message Message2 { 21 | optional bytes f_0 = 1 [ctype = CORD]; 22 | } 23 | -------------------------------------------------------------------------------- /fleetbench/llvmlibc.BUILD.bazel: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Fleetbench 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 | # https://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 | cc_library( 16 | name = "llvmlibc", 17 | visibility = ["//visibility:public"], 18 | deps = [ 19 | "//libc:bcmp", 20 | "//libc:bzero", 21 | "//libc:memcmp", 22 | "//libc:memcpy", 23 | "//libc:memmove", 24 | "//libc:memset", 25 | ], 26 | ) 27 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_2.csv: -------------------------------------------------------------------------------- 1 | 2:0.0122678,3:0.00117519,4:0.108375,5:0.00266567,6:0.00656386,7:0.0829798,8:0.0510777,9:0.000687916,10:0.00203508,11:0.00510204,12:0.00791103,13:0.0324753,15:0.000659252,16:0.00343958,17:0.000630589,18:0.00128984,19:5.73263e-05,20:0.000601926,21:0.00123252,22:0.000114653,23:0.000143316,24:0.43717,25:0.000315295,26:2.86632e-05,27:5.73263e-05,28:0.00656386,29:0.0165386,30:0.18783,33:0.0209241,34:0.0005446,35:0.000315295,36:0.00246503,37:8.59895e-05,38:0.000343958,39:5.73263e-05,40:0.000343958,41:8.59895e-05,42:0.000945884,43:0.000372621,44:0.0010892,47:8.59895e-05,73:2.86632e-05,74:0.000286632,75:0.000171979,76:0.000229305,77:0.000114653,78:2.86632e-05,79:0.000143316,80:5.73263e-05,81:8.59895e-05,82:0.000573263,83:0.000315295,90:5.73263e-05,92:8.59895e-05,95:5.73263e-05,98:2.86632e-05,103:2.86632e-05,108:2.86632e-05,163:2.86632e-05 2 | 0:0.994038,1:0.00596194 3 | 1:0.503812,2:0.126061,4:0.043482,8:0.016424,16:0.146669,32:0.0754987,64:0.0880532 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4/response/Message0.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P4.response.Message0; 19 | 20 | message Message0 { 21 | optional int64 f_0 = 3; 22 | message M1 { 23 | optional int32 f_0 = 2; 24 | } 25 | optional M1 f_4 = 4; 26 | } 27 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6/response/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P6.response.Message1; 19 | 20 | message Message1 { 21 | optional string f_0 = 1; 22 | message M1 { 23 | optional sfixed64 f_0 = 1; 24 | } 25 | optional M1 f_2 = 2; 26 | } 27 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P8/response/Message0.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P8.response.Message0; 19 | 20 | message Message0 { 21 | optional float f_0 = 1; 22 | message M1 { 23 | optional uint32 f_0 = 1; 24 | } 25 | optional M1 f_2 = 2; 26 | } 27 | -------------------------------------------------------------------------------- /fleetbench/stl/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 3 | 4 | package(default_visibility = ["//visibility:private"]) 5 | 6 | cc_library( 7 | name = "cord_benchmark_lib", 8 | testonly = True, 9 | srcs = [ 10 | "cord_benchmark.cc", 11 | "generated_cord_benchmarks.cc", 12 | "generated_cord_benchmarks.h", 13 | ], 14 | visibility = ["//fleetbench:__pkg__"], 15 | deps = [ 16 | "//fleetbench:dynamic_registrar", 17 | "//fleetbench/common", 18 | "@com_google_absl//absl/strings", 19 | "@com_google_absl//absl/strings:cord", 20 | "@com_google_benchmark//:benchmark", 21 | ], 22 | alwayslink = True, 23 | ) 24 | 25 | cc_test( 26 | name = "cord_benchmark", 27 | linkstatic = 1, 28 | malloc = "@com_google_tcmalloc//tcmalloc", 29 | deps = [ 30 | ":cord_benchmark_lib", 31 | "//fleetbench:benchmark_main", 32 | ], 33 | ) 34 | -------------------------------------------------------------------------------- /.github/workflows/update.yml: -------------------------------------------------------------------------------- 1 | name: monthly_release 2 | on: 3 | schedule: 4 | - cron: "0 0 1 * *" # First day of month 5 | 6 | jobs: 7 | monthly_release: 8 | name: GitHub Monthly Release 9 | runs-on: ubuntu-latest 10 | permissions: 11 | contents: write 12 | steps: 13 | # Update checkout version and add fetch-depth 14 | - uses: actions/checkout@v6 15 | with: 16 | fetch-depth: 0 17 | 18 | - uses: anothrNick/github-tag-action@1.64.0 19 | id: set_release_tag 20 | env: 21 | # Use Fleetbench PAT secret 22 | GITHUB_TOKEN: ${{ secrets.FLEETBENCH_PAT }} 23 | WITH_V: true 24 | DEFAULT_BUMP: patch 25 | INITIAL_VERSION: 2.0.1 26 | 27 | - uses: marvinpinto/action-automatic-releases@v1.2.1 28 | with: 29 | repo_token: "${{ secrets.FLEETBENCH_PAT }}" 30 | prerelease: true 31 | automatic_release_tag: ${{ steps.set_release_tag.outputs.new_tag }} -------------------------------------------------------------------------------- /fleetbench/patches/BUILD.bazel: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2024 The Fleetbench Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License" ); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an " AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | package(default_visibility = ["//visibility:public"]) 18 | 19 | # Note: The patches in this directory were generated by checking out the code from github at the 20 | # same revision specified in the WORKSPACE, committing the change, then running 21 | # `git format-patch -k HEAD^` to generate each patch file and copying it into this directory. 22 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P2/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P2.response.Message2; 19 | 20 | message Message2 { 21 | optional float f_0 = 2; 22 | message M1 { 23 | optional string f_0 = 1; 24 | optional int32 f_1 = 4; 25 | } 26 | optional M1 f_3 = 3; 27 | } 28 | -------------------------------------------------------------------------------- /fleetbench/patches/0001-Remove-more_deps-argument.patch: -------------------------------------------------------------------------------- 1 | From 539ed65872666f5d2c01d535adb4151e9aaa1402 Mon Sep 17 00:00:00 2001 2 | From: Richard O'Grady 3 | Date: Mon, 2 Dec 2024 16:32:22 -0800 4 | Subject: Remove more_deps argument 5 | 6 | This is not part of upstream protobuf build rules. 7 | --- 8 | scann/scann/oss_wrappers/build_defs.bzl | 1 - 9 | 1 file changed, 1 deletion(-) 10 | 11 | diff --git a/scann/scann/oss_wrappers/build_defs.bzl b/scann/scann/oss_wrappers/build_defs.bzl 12 | index 9103d4788..5259dd160 100644 13 | --- a/scann/scann/oss_wrappers/build_defs.bzl 14 | +++ b/scann/scann/oss_wrappers/build_defs.bzl 15 | @@ -25,6 +25,5 @@ def scann_py_proto_library( 16 | deps = py_proto_deps, 17 | default_runtime = "@com_google_protobuf//:protobuf_python", 18 | protoc = "@com_google_protobuf//:protoc", 19 | - more_deps = ["@com_google_protobuf//:well_known_types_py_pb2_genproto"], 20 | **kwargs 21 | ) 22 | -- 23 | 2.47.0.338.g60cca15819-goog 24 | 25 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4/response/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P4.response.Message1; 19 | 20 | message Message1 { 21 | optional fixed64 f_0 = 2; 22 | optional int64 f_1 = 4; 23 | optional bytes f_2 = 5 [ctype = CORD]; 24 | optional bytes f_3 = 6 [ctype = CORD]; 25 | } 26 | -------------------------------------------------------------------------------- /fleetbench/common/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 3 | 4 | package(default_visibility = ["//fleetbench:__subpackages__"]) 5 | 6 | cc_library( 7 | name = "common", 8 | srcs = ["common.cc"], 9 | hdrs = [ 10 | "common.h", 11 | ], 12 | linkstatic = 1, 13 | deps = [ 14 | "@bazel_tools//tools/cpp/runfiles", 15 | "@com_google_absl//absl/container:btree", 16 | "@com_google_absl//absl/flags:flag", 17 | "@com_google_absl//absl/log", 18 | "@com_google_absl//absl/log:check", 19 | "@com_google_absl//absl/strings", 20 | "@com_google_benchmark//:benchmark", 21 | ], 22 | alwayslink = 1, 23 | ) 24 | 25 | cc_test( 26 | name = "common_test", 27 | srcs = ["common_test.cc"], 28 | deps = [ 29 | ":common", 30 | "@com_google_absl//absl/flags:flag", 31 | "@com_google_absl//absl/strings", 32 | "@com_google_googletest//:gtest_main", 33 | ], 34 | ) 35 | -------------------------------------------------------------------------------- /fleetbench/llvm_project.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | """Apply llvm_configure to produce a llvm-project repo.""" 16 | 17 | load("@llvm//utils/bazel:configure.bzl", "llvm_configure") 18 | 19 | llvm_project = module_extension( 20 | implementation = lambda ctx: llvm_configure( 21 | name = "llvm-project", 22 | targets = [ 23 | "AArch64", 24 | "X86", 25 | ], 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /fleetbench/simd/tensorflow_support/MODULE.bazel: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | # In bzlmod mode, bazel build ... will traverse into bazel-generated 16 | # subdirectories. This file lists sub-repos to exclude. 17 | # Previously, the presence of a WORKSPACE file would cause bazel to ignore it. 18 | 19 | module(name = "local_config_tf") 20 | 21 | bazel_dep(name = "abseil-cpp", version = "20240722.0.bcr.2", repo_name = "com_google_absl") 22 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0/request/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P0.request.Message2; 19 | 20 | message Message2 { 21 | optional double f_0 = 1; 22 | message M1 { 23 | optional int32 f_0 = 1; 24 | } 25 | repeated M1 f_2 = 2; 26 | message M2 { 27 | optional string f_0 = 1; 28 | } 29 | optional M2 f_3 = 3; 30 | } 31 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6/request/Message0.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P6.request.Message0; 19 | 20 | message Message0 { 21 | optional string f_0 = 1; 22 | message M1 { 23 | optional int32 f_0 = 1; 24 | } 25 | repeated M1 f_2 = 2; 26 | message M2 { 27 | optional fixed32 f_0 = 1; 28 | } 29 | optional M2 f_3 = 3; 30 | } 31 | -------------------------------------------------------------------------------- /fleetbench/compression/zstd.BUILD: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Fleetbench 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 | # https://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 | package( 16 | default_visibility = ["//visibility:public"], 17 | features = ["header_modules"], 18 | ) 19 | 20 | licenses(["notice"]) 21 | 22 | cc_library( 23 | name = "zstdlib", 24 | srcs = glob([ 25 | "common/*.c", 26 | "common/*.h", 27 | "compress/*.c", 28 | "compress/*.h", 29 | "decompress/*.c", 30 | "decompress/*.h", 31 | ]), 32 | hdrs = ["zstd.h"], 33 | ) 34 | -------------------------------------------------------------------------------- /fleetbench/requirements.in: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | # This is the list of our Python third_party dependencies that Bazel should 16 | # pull from PyPi. 17 | # Note that requirements.txt must be re-generated using 18 | # bazel run //fleetbench:requirements.update in the OSS version. 19 | # 20 | numpy==2.1.1 # 2024-09-10 21 | brotli==1.2.0 # 2025-12-15 22 | zstandard==0.23.0 # 2024-09-10 23 | python-snappy==0.7.3 # 2024-09-10 24 | psutil==6.0.0 # 2024-09-10 25 | pandas==2.2.2 # 2024-09-10 26 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P4.response.Message2; 19 | 20 | message Message2 { 21 | enum E1 { 22 | E1_UNSPECIFIED = 0; 23 | E1_CONST_1 = 71; 24 | E1_CONST_2 = 115; 25 | E1_CONST_3 = 19; 26 | E1_CONST_4 = 8; 27 | E1_CONST_5 = 65; 28 | } 29 | repeated E1 f_0 = 2 [packed = true]; 30 | optional double f_1 = 3; 31 | } 32 | -------------------------------------------------------------------------------- /fleetbench/parallel/result.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | """Result of a benchmark run.""" 16 | 17 | import dataclasses 18 | from typing import Optional 19 | 20 | 21 | @dataclasses.dataclass(frozen=True) 22 | class Result: 23 | """Result of a benchmark run.""" 24 | 25 | benchmark: str 26 | rc: int 27 | stdout: str 28 | stderr: str 29 | result: str = "" 30 | duration: Optional[float] = None 31 | bm_wall_time: Optional[float] = None 32 | bm_cpu_time: Optional[float] = None 33 | iteration: Optional[int] = None 34 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_5.csv: -------------------------------------------------------------------------------- 1 | 0:0.00347842,1:0.0101532,2:0.0098712,3:0.0353483,4:0.0307418,5:0.0286735,6:0.0339381,7:0.0287675,8:0.0537746,9:0.0682523,10:0.108959,11:0.0204005,12:0.0194604,13:0.0272633,14:0.0332801,15:0.0498261,16:0.0274513,17:0.0114694,18:0.00874307,19:0.0280154,20:0.0219047,21:0.01664,22:0.0266052,23:0.0307418,24:0.0204005,25:0.0308358,26:0.024725,27:0.0303657,28:0.0193664,29:0.0109053,30:0.00789696,31:0.0175801,32:0.0200244,33:0.0271693,34:0.00535865,35:0.00385447,36:0.00310238,37:0.00667481,38:0.00864906,39:0.00206825,40:0.0117514,41:0.00197424,42:0.00141017,43:0.000940115,44:0.000564069,45:0.00131616,46:9.40115e-05,50:9.40115e-05,51:0.000282034,54:0.000282034,55:0.000188023,56:0.000376046,57:0.00122215,60:0.00065808,62:9.40115e-05,63:0.000188023,64:0.00112814,65:9.40115e-05,66:9.40115e-05,68:9.40115e-05,71:0.000188023,72:0.000282034,73:9.40115e-05,74:0.000282034,75:0.00216226,76:9.40115e-05,87:9.40115e-05,95:0.000188023,98:0.000188023,103:0.000282034,105:0.000188023,106:0.000188023,108:9.40115e-05,141:9.40115e-05 2 | 0:0.838488,1:0.161512 3 | 1:0.237943,2:0.106233,4:0.0345022,8:0.195074,16:0.0580991,32:0.157375,64:0.210774 4 | -------------------------------------------------------------------------------- /fleetbench/hashing/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 3 | 4 | package(default_visibility = ["//visibility:private"]) 5 | 6 | cc_library( 7 | name = "hashing_benchmark_lib", 8 | testonly = True, 9 | srcs = ["hashing_benchmark.cc"], 10 | data = glob(["distributions/**"]), 11 | visibility = ["//fleetbench:__pkg__"], 12 | deps = [ 13 | "//fleetbench:dynamic_registrar", 14 | "//fleetbench/common", 15 | "@com_google_absl//absl/base:no_destructor", 16 | "@com_google_absl//absl/container:btree", 17 | "@com_google_absl//absl/container:flat_hash_map", 18 | "@com_google_absl//absl/crc:crc32c", 19 | "@com_google_absl//absl/hash", 20 | "@com_google_absl//absl/strings", 21 | "@com_google_benchmark//:benchmark", 22 | ], 23 | alwayslink = True, 24 | ) 25 | 26 | cc_test( 27 | name = "hashing_benchmark", 28 | linkstatic = 1, 29 | malloc = "@com_google_tcmalloc//tcmalloc", 30 | deps = [ 31 | ":hashing_benchmark_lib", 32 | "//fleetbench:benchmark_main", 33 | ], 34 | ) 35 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memset_4.csv: -------------------------------------------------------------------------------- 1 | 1:0.0369276,2:0.028065,3:0.00590842,4:0.028065,6:0.00295421,8:0.29099,10:0.00443131,12:0.00738552,15:0.00295421,16:0.0901034,17:0.0118168,19:0.0014771,22:0.0014771,23:0.0014771,24:0.00443131,28:0.00295421,30:0.0014771,31:0.0014771,32:0.0236337,39:0.0014771,40:0.0014771,47:0.00590842,48:0.00443131,50:0.0014771,52:0.0014771,60:0.00443131,64:0.05613,68:0.00295421,72:0.0265879,80:0.0014771,88:0.00295421,96:0.0162482,104:0.0546529,106:0.042836,120:0.00295421,124:0.0014771,128:0.00295421,136:0.0014771,143:0.00295421,152:0.0014771,160:0.0310192,168:0.0014771,192:0.0014771,200:0.00738552,208:0.00886263,214:0.0014771,240:0.0014771,251:0.0014771,252:0.00443131,256:0.00295421,272:0.0162482,296:0.0014771,320:0.00295421,384:0.00738552,440:0.0014771,504:0.0014771,508:0.00886263,512:0.0103397,528:0.0014771,576:0.0014771,688:0.0103397,799:0.014771,811:0.0014771,814:0.0014771,1022:0.00295421,1475:0.0014771,1595:0.0103397,2038:0.00886263,3874:0.0014771,4043:0.0014771,4091:0.00443131,6380:0.00886263,8188:0.0014771,15704:0.0014771,30829:0.0014771,32685:0.0014771,65426:0.0251108 2 | 0:1 3 | 1:0.042836,2:0.0162482,4:0.0384047,8:0.292467,16:0.258493,32:0.098966,64:0.252585 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1/request/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P1.request.Message2; 19 | 20 | message Message2 { 21 | repeated string f_0 = 1; 22 | message M1 { 23 | optional bool f_0 = 2; 24 | optional bool f_1 = 5; 25 | message M2 { 26 | optional string f_0 = 1; 27 | optional int64 f_1 = 2; 28 | optional bool f_2 = 4; 29 | } 30 | optional M2 f_6 = 6; 31 | } 32 | optional M1 f_2 = 2; 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/libnuma.BUILD.bazel: -------------------------------------------------------------------------------- 1 | # Copyright 2025 The Fleetbench 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 | # https://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 | cc_library( 16 | name = "numa", 17 | visibility = ["//visibility:public"], 18 | srcs = [ 19 | "affinity.c", 20 | "config.h", 21 | "distance.c", 22 | "libnuma.c", 23 | "rtnetlink.c", 24 | "syscall.c", 25 | "sysfs.c", 26 | ], 27 | hdrs = [ 28 | "affinity.h", 29 | "numa.h", 30 | "numaif.h", 31 | "numaint.h", 32 | "rtnetlink.h", 33 | "sysfs.h", 34 | "util.h", 35 | ], 36 | linkstatic = True, 37 | ) 38 | -------------------------------------------------------------------------------- /fleetbench/simd/tensorflow_support/BUILD.bazel: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2024 The Fleetbench Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License" ); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an " AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | package(default_visibility = ["//visibility:public"]) 18 | 19 | cc_library( 20 | name = "tf_header_lib", 21 | hdrs = [ 22 | "tensorflow/core/lib/core/threadpool.h", 23 | "tensorflow/core/platform/cpu_info.h", 24 | ], 25 | ) 26 | 27 | cc_library( 28 | name = "libtensorflow_framework", 29 | srcs = ["tensorflow/core/platform/cpu_info.cc"], 30 | deps = [ 31 | ":tf_header_lib", 32 | "@com_google_absl//absl/base", 33 | "@com_google_absl//absl/log:check", 34 | ], 35 | ) 36 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_8.csv: -------------------------------------------------------------------------------- 1 | 0:0.0218858,1:0.0241896,2:0.0319236,3:0.0533158,4:0.0302781,5:0.0134935,6:0.0190884,7:0.00625309,8:0.181669,9:0.088366,10:0.0131644,11:0.0149745,12:0.0518348,13:0.0128353,14:0.0125062,15:0.0246832,16:0.100708,17:0.026987,18:0.0102024,19:0.0100378,20:0.00526576,21:0.0184301,22:0.00905052,23:0.0110252,24:0.056936,25:0.00773408,26:0.011848,27:0.00526576,28:0.0065822,29:0.0129998,30:0.00444298,31:0.0051012,32:0.0189238,33:0.00575942,34:0.00345565,35:0.00641764,36:0.00707586,37:0.00427843,38:0.00279743,39:0.00707586,40:0.00230377,41:0.00345565,42:0.00230377,43:0.00197466,44:0.00131644,45:0.00230377,46:0.00213921,47:0.00065822,48:0.0051012,49:0.000987329,50:0.00115188,51:0.000987329,52:0.00065822,53:0.00032911,54:0.00148099,55:0.00131644,56:0.00065822,57:0.00032911,58:0.00032911,59:0.000493665,60:0.00213921,61:0.00065822,62:0.0018101,65:0.000164555,67:0.000493665,68:0.000164555,69:0.000164555,70:0.00032911,72:0.000164555,73:0.000987329,75:0.000493665,76:0.000493665,77:0.00065822,78:0.000493665,81:0.000164555,82:0.000164555,83:0.000164555,87:0.000164555,95:0.00032911,103:0.00032911,161:0.000164555,306:0.000164555 2 | 0:1 3 | 1:0.0886951,2:0.116011,4:0.091328,8:0.146125,16:0.149416,32:0.158795,64:0.24963 4 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memmove_7.csv: -------------------------------------------------------------------------------- 1 | 1:0.141221,2:0.0114504,3:0.00763359,4:0.0305344,5:0.0229008,6:0.00381679,7:0.00381679,8:0.0114504,9:0.0114504,10:0.0152672,12:0.00381679,13:0.00381679,14:0.00763359,15:0.00381679,16:0.148855,17:0.0114504,18:0.00381679,19:0.00381679,20:0.0152672,21:0.0496183,23:0.0114504,24:0.00381679,25:0.0152672,26:0.0114504,27:0.0114504,28:0.00763359,29:0.00381679,30:0.00763359,31:0.00381679,32:0.0114504,33:0.0114504,34:0.0152672,35:0.0267176,36:0.0152672,37:0.00381679,38:0.0114504,39:0.00381679,40:0.00381679,41:0.0152672,42:0.0114504,43:0.00381679,44:0.00763359,45:0.019084,46:0.0114504,47:0.00763359,48:0.00763359,49:0.0114504,50:0.00381679,51:0.019084,52:0.00381679,53:0.00763359,54:0.00763359,55:0.00381679,56:0.00763359,57:0.00381679,58:0.00381679,60:0.00763359,61:0.00763359,62:0.00763359,63:0.00381679,65:0.0114504,66:0.00763359,67:0.0114504,71:0.00381679,72:0.0152672,73:0.00381679,74:0.0114504,76:0.00381679,80:0.00381679,85:0.00763359,95:0.00381679,96:0.00763359,99:0.00381679,123:0.00381679,124:0.00381679,127:0.00381679,141:0.00381679,151:0.00381679,154:0.00381679,194:0.00381679,204:0.00381679 2 | 0:0.992366,1:0.00763359 3 | 1:0.00763359,2:0.00763359,4:0.00381679,8:0.21374,16:0.278626,32:0.175573,64:0.312977 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P10.response.Message2; 19 | 20 | message Message2 { 21 | optional int64 f_0 = 1; 22 | optional int64 f_1 = 2; 23 | optional int32 f_2 = 4; 24 | message M1 { 25 | optional bool f_0 = 1; 26 | } 27 | optional M1 f_6 = 6; 28 | message M2 { 29 | optional bool f_0 = 2; 30 | } 31 | repeated M2 f_9 = 9; 32 | message M3 { 33 | optional int64 f_0 = 1; 34 | } 35 | optional M3 f_10 = 10; 36 | } 37 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P7/request/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P7.request.Message1; 19 | 20 | message Message1 { 21 | optional string f_0 = 1; 22 | optional int32 f_1 = 3; 23 | enum E1 { 24 | E1_UNSPECIFIED = 0; 25 | E1_CONST_1 = 69; 26 | E1_CONST_2 = 37; 27 | E1_CONST_3 = 100; 28 | E1_CONST_4 = 72; 29 | E1_CONST_5 = 124; 30 | } 31 | optional E1 f_2 = 4; 32 | optional string f_3 = 7; 33 | optional string f_4 = 9; 34 | optional string f_5 = 10; 35 | } 36 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10/request/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P10.request.Message2; 19 | 20 | message Message2 { 21 | optional int64 f_0 = 1; 22 | optional int32 f_1 = 3; 23 | optional int32 f_2 = 4; 24 | message M1 { 25 | optional string f_0 = 1; 26 | } 27 | repeated M1 f_5 = 5; 28 | message M2 { 29 | optional uint64 f_0 = 1; 30 | } 31 | repeated M2 f_6 = 6; 32 | message M3 { 33 | repeated uint64 f_0 = 1 [packed = true]; 34 | } 35 | optional M3 f_7 = 7; 36 | } 37 | -------------------------------------------------------------------------------- /fleetbench/rpc/fleetbenchservice.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | syntax = "proto2"; 16 | 17 | package fleetbench.rpc; 18 | 19 | import "fleetbench/rpc/protos/RequestMessage.proto"; 20 | import "fleetbench/rpc/protos/ResponseMessage.proto"; 21 | 22 | // FleetBenchPerf is a service for benchmarking RPC performance by sending 23 | // and receiving fleet-representative messages. 24 | service FleetBenchPerf { 25 | // Handles a message and returns a random response. May add a delay depending 26 | // on service configuration. 27 | rpc Message(fleetbench.rpc.RequestMessage) 28 | returns (fleetbench.rpc.ResponseMessage) {} 29 | } 30 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P0/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P0/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P0/request/Message2.proto"; 26 | 27 | message P0RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P0.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P0.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P0.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P1/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P1/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P1/request/Message2.proto"; 26 | 27 | message P1RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P1.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P1.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P1.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P2RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P2/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P2/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P2/request/Message2.proto"; 26 | 27 | message P2RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P2.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P2.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P2.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P3/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P3/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P3/request/Message2.proto"; 26 | 27 | message P3RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P3.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P3.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P3.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P4/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P4/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P4/request/Message2.proto"; 26 | 27 | message P4RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P4.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P4.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P4.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P5RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P5/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P5/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P5/request/Message2.proto"; 26 | 27 | message P5RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P5.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P5.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P5.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6/request/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P6.request.Message2; 19 | 20 | message Message2 { 21 | enum E1 { 22 | E1_UNSPECIFIED = 0; 23 | E1_CONST_1 = 63; 24 | E1_CONST_2 = 17; 25 | E1_CONST_3 = 79; 26 | E1_CONST_4 = 11; 27 | E1_CONST_5 = 36; 28 | } 29 | repeated E1 f_0 = 1 [packed = true]; 30 | message M1 { 31 | optional int32 f_0 = 1; 32 | } 33 | repeated M1 f_2 = 2; 34 | message M2 { 35 | optional string f_0 = 1; 36 | } 37 | optional M2 f_3 = 3; 38 | } 39 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P6/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P6/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P6/request/Message2.proto"; 26 | 27 | message P6RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P6.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P6.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P6.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P7RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P7/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P7/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P7/request/Message2.proto"; 26 | 27 | message P7RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P7.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P7.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P7.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P8RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P8/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P8/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P8/request/Message2.proto"; 26 | 27 | message P8RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P8.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P8.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P8.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P9/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P9/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P9/request/Message2.proto"; 26 | 27 | message P9RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P9.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P9.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P9.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/productivity_reporter.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #include "fleetbench/productivity_reporter.h" 15 | 16 | #include 17 | #include 18 | 19 | #include "benchmark/benchmark.h" 20 | 21 | namespace fleetbench { 22 | // Class to receive updates while benchmark is in progress. 23 | // Currently this does nothing. 24 | class NoOpReporter : public ProductivityReporter { 25 | public: 26 | void Update(benchmark::State& state) override {} 27 | }; 28 | ProductivityReporter* ProductivityReporter::Get() { 29 | static ProductivityReporter* reporter = new NoOpReporter(); 30 | return reporter; 31 | } 32 | 33 | } // namespace fleetbench 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P0/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P0/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P0/response/Message2.proto"; 26 | 27 | message P0ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P0.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P0.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P0.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P10/request/Message0.proto"; 24 | import "fleetbench/rpc/protos/P10/request/Message1.proto"; 25 | import "fleetbench/rpc/protos/P10/request/Message2.proto"; 26 | 27 | message P10RequestMessage { 28 | oneof msg { 29 | fleetbench.rpc.P10.request.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P10.request.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P10.request.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P1/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P1/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P1/response/Message2.proto"; 26 | 27 | message P1ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P1.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P1.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P1.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P2ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P2/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P2/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P2/response/Message2.proto"; 26 | 27 | message P2ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P2.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P2.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P2.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P3/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P3/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P3/response/Message2.proto"; 26 | 27 | message P3ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P3.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P3.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P3.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P4/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P4/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P4/response/Message2.proto"; 26 | 27 | message P4ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P4.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P4.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P4.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P5ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P5/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P5/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P5/response/Message2.proto"; 26 | 27 | message P5ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P5.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P5.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P5.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P6/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P6/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P6/response/Message2.proto"; 26 | 27 | message P6ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P6.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P6.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P6.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P7ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P7/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P7/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P7/response/Message2.proto"; 26 | 27 | message P7ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P7.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P7.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P7.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P8ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P8/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P8/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P8/response/Message2.proto"; 26 | 27 | message P8ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P8.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P8.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P8.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P9/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P9/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P9/response/Message2.proto"; 26 | 27 | message P9ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P9.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P9.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P9.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P10/response/Message0.proto"; 24 | import "fleetbench/rpc/protos/P10/response/Message1.proto"; 25 | import "fleetbench/rpc/protos/P10/response/Message2.proto"; 26 | 27 | message P10ResponseMessage { 28 | oneof msg { 29 | fleetbench.rpc.P10.response.Message0.Message0 m_0 = 1; 30 | fleetbench.rpc.P10.response.Message1.Message1 m_1 = 2; 31 | fleetbench.rpc.P10.response.Message2.Message2 m_2 = 3; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /fleetbench/parallel/weights.csv: -------------------------------------------------------------------------------- 1 | #Benchmark name, weight 2 | BM_PROTO_Arena,1 3 | "BM_SWISSMAP_InsertMiss_Hot<::absl::flat_hash_set, 64>/set_size:64/density:0",1 4 | "BM_SWISSMAP_InsertMiss_Cold<::absl::flat_hash_set, 64>/set_size:64/density:0",1 5 | BM_LIBC_Memcpy_Fleet_LLC,1 6 | BM_LIBC_Memcpy_Fleet_Cold,1 7 | BM_LIBC_Memset_Fleet_LLC,1 8 | BM_LIBC_Memset_Fleet_Cold,1 9 | BM_LIBC_Memmove_Fleet_LLC,1 10 | BM_LIBC_Memmove_Fleet_Cold,1 11 | BM_LIBC_Memcmp_Fleet_LLC,1 12 | BM_LIBC_Memcmp_Fleet_Cold,1 13 | BM_LIBC_Bcmp_Fleet_LLC,1 14 | BM_LIBC_Bcmp_Fleet_Cold,1 15 | BM_TCMALLOC_5/real_time/threads:1,1 16 | BM_HASHING_Computecrc32c_Fleet_cold,1 17 | BM_HASHING_Extendcrc32cinternal_Fleet_cold,1 18 | BM_HASHING_Combine_contiguous_Fleet_cold,1 19 | BM_COMPRESSION_Brotli_COMPRESS_Fleet/compression_level:2/window_log:18,1 20 | BM_COMPRESSION_Brotli_DECOMPRESS_Fleet/compression_level:2/window_log:18,1 21 | BM_COMPRESSION_Flate_COMPRESS_Fleet/compression_level:6/window_log:15,1 22 | BM_COMPRESSION_Flate_DECOMPRESS_Fleet/compression_level:6/window_log:15,1 23 | BM_COMPRESSION_Snappy_COMPRESS_Fleet,1 24 | BM_COMPRESSION_Snappy_DECOMPRESS_Fleet,1 25 | BM_COMPRESSION_ZSTD_COMPRESS_Fleet/compression_level:-1/window_log:15,1 26 | BM_COMPRESSION_ZSTD_DECOMPRESS_Fleet/compression_level:0/window_log:0,1 27 | BM_CORD_Fleet,1 -------------------------------------------------------------------------------- /fleetbench/productivity_reporter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #ifndef THIRD_PARTY_FLEETBENCH_PRODUCTIVITY_REPORTER_H_ 15 | #define THIRD_PARTY_FLEETBENCH_PRODUCTIVITY_REPORTER_H_ 16 | 17 | #include "benchmark/benchmark.h" 18 | 19 | namespace fleetbench { 20 | 21 | // ProductivityReporter is meant to give progress updates more often 22 | // than the benchmark framework itself. 23 | class ProductivityReporter { 24 | public: 25 | static ProductivityReporter* Get(); 26 | virtual ~ProductivityReporter() = default; 27 | virtual void Update(benchmark::State& state) = 0; 28 | }; 29 | 30 | } // namespace fleetbench 31 | #endif // THIRD_PARTY_FLEETBENCH_PRODUCTIVITY_REPORTER_H_ 32 | -------------------------------------------------------------------------------- /fleetbench/patches/0003-Replace-non-standard-uint32-with-uint32_t.patch: -------------------------------------------------------------------------------- 1 | From 225c5b55dc854f7727ba85bd82ad6c91c03ceb65 Mon Sep 17 00:00:00 2001 2 | From: Richard O'Grady 3 | Date: Tue, 3 Dec 2024 15:04:05 -0800 4 | Subject: Replace non-standard uint32 with uint32_t. 5 | 6 | This type is not defined by anything this file includes. 7 | --- 8 | scann/scann/utils/fast_top_neighbors_impl.inc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/scann/scann/utils/fast_top_neighbors_impl.inc b/scann/scann/utils/fast_top_neighbors_impl.inc 12 | index 4a94ce81a..31f43364e 100644 13 | --- a/scann/scann/utils/fast_top_neighbors_impl.inc 14 | +++ b/scann/scann/utils/fast_top_neighbors_impl.inc 15 | @@ -191,7 +191,7 @@ SCANN_SIMD_INLINE size_t UseMasksToCompact(DatapointIndexT* indices, 16 | DistT* values, uint32_t* masks, 17 | size_t n_masks) { 18 | #if HWY_TARGET <= HWY_AVX2 19 | - if constexpr (IsSame() && IsSame()) { 20 | + if constexpr (IsSame() && IsSame()) { 21 | return HwyCompact(indices, values, masks, n_masks); 22 | } 23 | #endif 24 | -- 25 | 2.47.0.338.g60cca15819-goog 26 | 27 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4/request/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P4.request.Message1; 19 | 20 | message Message1 { 21 | optional string f_0 = 5; 22 | message M1 { 23 | optional bool f_0 = 5; 24 | message M2 { 25 | optional bytes f_0 = 5; 26 | optional int64 f_1 = 8; 27 | optional int32 f_2 = 13; 28 | optional bytes f_3 = 15; 29 | optional string f_4 = 19; 30 | optional int32 f_5 = 21; 31 | optional string f_6 = 23; 32 | } 33 | repeated M2 f_8 = 8; 34 | } 35 | optional M1 f_10 = 10; 36 | } 37 | -------------------------------------------------------------------------------- /fleetbench/libc/utils.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Fleetbench 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 | // https://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 | #include "fleetbench/libc/utils.h" 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace fleetbench { 22 | namespace libc { 23 | 24 | MemoryBuffers::MemoryBuffers(const size_t size, const size_t alignment) 25 | : size_(size), 26 | src_(reinterpret_cast( 27 | aligned_alloc(alignment, std::lcm(size_, alignment)))), 28 | dst_(reinterpret_cast( 29 | aligned_alloc(alignment, std::lcm(size_, alignment)))) { 30 | memset(src_, 0xFF, size); 31 | memset(dst_, 0xFF, size); 32 | } 33 | 34 | MemoryBuffers::~MemoryBuffers() { 35 | free(src_); 36 | free(dst_); 37 | } 38 | 39 | } // namespace libc 40 | } // namespace fleetbench 41 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_0.csv: -------------------------------------------------------------------------------- 1 | 0:0.00865676,1:0.00851248,2:0.00548261,3:0.026836,4:0.0352042,5:0.00894532,6:0.0441495,7:0.0108931,8:0.0175299,9:0.0321743,10:0.0318857,11:0.015005,12:0.0116866,13:0.0153657,14:0.0247439,15:0.01652,16:0.0113259,17:0.0041841,18:0.00706969,19:0.0372962,20:0.0083682,21:0.0839706,22:0.0697591,23:0.0275574,24:0.0176742,25:0.00678113,26:0.0103881,27:0.00468908,28:0.0045448,29:0.00476122,30:0.00706969,31:0.00858462,32:0.00432838,33:0.00245275,34:0.00187563,35:0.00245275,36:0.00353484,37:0.00432838,38:0.00281345,39:0.01652,40:0.0177464,41:0.00223633,42:0.00497764,43:0.00259703,44:0.0052662,45:0.0052662,46:0.0076468,47:0.00137065,48:0.00108209,49:0.00144279,50:0.00476122,51:0.000937816,52:0.00288559,53:0.000865676,54:0.00129851,55:0.000649257,56:0.00339056,57:0.000432838,58:0.000577117,59:0.00180349,60:0.0432838,61:0.00396768,62:0.000937816,63:0.00187563,64:0.000360698,65:7.21397e-05,66:0.0152215,67:0.00360698,68:0.000721397,69:0.00360698,70:0.00158707,71:0.000144279,72:0.00201991,73:0.000144279,74:0.00274131,75:0.00144279,78:0.000288559,79:0.000288559,81:0.0149329,82:0.000504978,83:0.0564854,84:0.0957293,85:0.000144279,86:0.0152215,91:7.21397e-05,122:0.000216419,123:0.000504978,124:0.000360698,128:7.21397e-05,352:7.21397e-05,646:7.21397e-05,868:7.21397e-05,1134:7.21397e-05 2 | 0:0.999928,1:7.21397e-05 3 | 1:0.329173,2:0.145866,4:0.101428,8:0.103448,16:0.0529505,32:0.086784,64:0.180349 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P6.response.Message2; 19 | 20 | message Message2 { 21 | optional uint32 f_0 = 2; 22 | optional int64 f_1 = 3; 23 | optional int64 f_2 = 4; 24 | message M1 { 25 | enum E1 { 26 | E1_UNSPECIFIED = 0; 27 | E1_CONST_1 = 63; 28 | E1_CONST_2 = 123; 29 | E1_CONST_3 = 12; 30 | E1_CONST_4 = 4; 31 | E1_CONST_5 = 109; 32 | } 33 | optional E1 f_0 = 1; 34 | } 35 | optional M1 f_5 = 5; 36 | message M2 { 37 | optional string f_0 = 1; 38 | } 39 | optional M2 f_6 = 6; 40 | message M3 { 41 | optional string f_0 = 1; 42 | } 43 | optional M3 f_7 = 7; 44 | } 45 | -------------------------------------------------------------------------------- /fleetbench/proto/benchmark_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Fleetbench 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 | // https://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 | // This file defines the skeleton of generated benchmark files. It contains 15 | // the includes, gunit benchmark code, and main entrypoint. 16 | 17 | #include "gtest/gtest.h" 18 | #include "fleetbench/proto/lifecycle.h" 19 | #include "google/protobuf/arena.h" 20 | 21 | namespace fleetbench::proto { 22 | TEST(ProtoBenchmarkTest, Arena) { 23 | ProtoLifecycle lifecycle(1); 24 | google::protobuf::Arena arena; 25 | lifecycle.Init(&arena); 26 | lifecycle.Run(); 27 | EXPECT_EQ(lifecycle.GetWorkingSetSize(), 1); 28 | } 29 | 30 | TEST(ProtoBenchmarkTest, NoArena) { 31 | ProtoLifecycle lifecycle(1); 32 | lifecycle.Init(nullptr); 33 | lifecycle.Run(); 34 | EXPECT_EQ(lifecycle.GetWorkingSetSize(), 1); 35 | } 36 | 37 | } // namespace fleetbench::proto 38 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcpy_7.csv: -------------------------------------------------------------------------------- 1 | 0:0.116832,1:0.0693069,2:0.0653465,3:0.0118812,4:0.0633663,5:0.0118812,6:0.019802,7:0.0158416,8:0.0415842,9:0.0237624,10:0.0356436,11:0.0019802,12:0.0435644,13:0.0415842,14:0.0237624,15:0.0118812,16:0.019802,17:0.00594059,19:0.0039604,20:0.019802,21:0.019802,22:0.0039604,23:0.00594059,24:0.00990099,25:0.00594059,26:0.0019802,27:0.00594059,29:0.0039604,30:0.0039604,31:0.0019802,32:0.0178218,33:0.0019802,34:0.0019802,35:0.00594059,36:0.00792079,38:0.00990099,39:0.00990099,40:0.0039604,41:0.0039604,42:0.00792079,43:0.0039604,44:0.0039604,45:0.0039604,46:0.0019802,48:0.00594059,49:0.0039604,50:0.00792079,51:0.0138614,52:0.0039604,53:0.0039604,54:0.0257426,55:0.0039604,56:0.0039604,57:0.00594059,58:0.00594059,59:0.0019802,61:0.00594059,62:0.0039604,64:0.0039604,65:0.0019802,69:0.0039604,70:0.0019802,71:0.0039604,72:0.00594059,73:0.0039604,74:0.0019802,75:0.0019802,76:0.0019802,80:0.0019802,81:0.0019802,82:0.0019802,89:0.0039604,90:0.0019802,95:0.0019802,105:0.0019802,106:0.0039604,108:0.0019802,114:0.0019802,118:0.0019802,119:0.0019802,124:0.0019802,128:0.0019802,134:0.0019802,139:0.0019802,162:0.0019802,173:0.0019802,176:0.0039604,193:0.0019802,196:0.0019802,256:0.0019802,283:0.0019802,312:0.0019802,404:0.0019802,432:0.0019802,464:0.0019802,522:0.0019802,552:0.0019802,706:0.0019802,748:0.0019802,1022:0.0039604,1118:0.0019802,21123:0.0019802 2 | 0:1 3 | 1:0.138614,2:0.0891089,4:0.0554455,8:0.192079,16:0.261386,32:0.122772,64:0.140594 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/distributionargs.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | syntax = "proto2"; 16 | 17 | package fleetbench.rpc; 18 | 19 | message DistributionArgs { 20 | optional string distribution = 1; 21 | 22 | optional int32 constant_value = 2 [default = 0]; 23 | 24 | optional int32 uniform_min = 3 [default = 0]; 25 | optional int32 uniform_max = 4 [default = 1]; 26 | 27 | optional double exponential_lambda = 5 [default = 1]; 28 | optional int32 exponential_max = 6 [default = 1000]; 29 | 30 | optional double gaussian_mean = 7 [default = 0]; 31 | optional double gaussian_stdev = 8 [default = 1]; 32 | optional int32 gaussian_max = 9 [default = 1000]; 33 | 34 | optional int32 poisson_mean = 10 [default = 1]; 35 | optional int32 poisson_max = 11 [default = 1000]; 36 | 37 | repeated int32 empirical = 12 [packed = true]; 38 | } 39 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: Fleetbench CI 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | fail-fast: true 13 | matrix: 14 | os: [ubuntu-latest, arm-ubuntu-arm-22.04-16core] 15 | config: [fastbuild, opt] 16 | compiler: 17 | - name: gcc 18 | flags: "" 19 | - name: clang 20 | flags: "--config=clang" 21 | 22 | runs-on: ${{ matrix.os }} 23 | name: "Build/Test ${{ matrix.os }} ${{ matrix.compiler.name }} ${{ matrix.config }}" 24 | steps: 25 | - if: matrix.os == 'arm-ubuntu-arm-22.04-16core' && matrix.compiler.name == 'clang' 26 | name: Make clang-15 default 27 | run: | 28 | sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 100 29 | sudo update-alternatives --set clang /usr/bin/clang-15 30 | - name: Setup Python 31 | uses: actions/setup-python@v5 32 | with: 33 | python-version: "3.12" 34 | - uses: actions/checkout@v6 35 | with: 36 | fetch-depth: 0 37 | 38 | - name: Build 39 | run: | 40 | bazel run //fleetbench:requirements.update 41 | bazel build -c ${{ matrix.config }} ${{ matrix.compiler.flags }} //... 42 | - name: Test 43 | run: | 44 | bazel test -c ${{ matrix.config }} ${{ matrix.compiler.flags }} --test_output=errors //... 45 | 46 | -------------------------------------------------------------------------------- /fleetbench/hashing/distributions/Combine_contiguous_3.csv: -------------------------------------------------------------------------------- 1 | 0:0.0303553,1:0.00689893,2:0.00241463,3:0.0375992,4:0.00914108,5:0.0110383,6:0.0315626,7:0.155226,8:0.00793377,9:0.00310452,10:0.00827872,11:0.0103484,12:0.025871,13:0.0162125,14:0.00413936,15:0.01604,16:0.00189721,17:0.00741635,18:0.0103484,19:0.00172473,20:0.0420835,21:0.0103484,22:0.00189721,23:0.00379441,24:0.00810624,25:0.00396689,26:0.0714039,27:0.000862366,28:0.00275957,29:0.00206968,30:0.00137979,31:0.00137979,32:0.00120731,33:0.00137979,34:0.00310452,35:0.00172473,36:0.00103484,37:0.00103484,38:0.00224215,39:0.000172473,40:0.000689893,41:0.000344947,42:0.000689893,43:0.000344947,44:0.00914108,45:0.000344947,46:0.000172473,47:0.000344947,51:0.000344947,53:0.00620904,54:0.000689893,55:0.000344947,58:0.000344947,60:0.137979,61:0.000862366,62:0.000172473,63:0.000344947,65:0.236288,66:0.000862366,68:0.000172473,73:0.000344947,74:0.000344947,75:0.000344947,76:0.00051742,80:0.000172473,82:0.000172473,84:0.000344947,86:0.000172473,87:0.000172473,88:0.000344947,89:0.000172473,90:0.000172473,91:0.000172473,93:0.000344947,94:0.00120731,95:0.00051742,96:0.000862366,97:0.00120731,98:0.00103484,99:0.0044843,100:0.00206968,101:0.000689893,105:0.000689893,106:0.00103484,110:0.000689893,111:0.00051742,112:0.000172473,113:0.00396689,114:0.00500172,117:0.00206968,118:0.000172473,119:0.000172473,121:0.000172473,124:0.000344947,127:0.000172473,129:0.00051742,132:0.00051742,133:0.000172473,136:0.000172473,143:0.0103484,147:0.000172473,632:0.000172473,682:0.000172473,859:0.000172473,906:0.000172473,970:0.000172473 2 | -------------------------------------------------------------------------------- /fleetbench/patches/0002-Replace-gtest_main-with-gtest.patch: -------------------------------------------------------------------------------- 1 | From 19c7b67870ea6915c767e0b3b1e96c19bf60827a Mon Sep 17 00:00:00 2001 2 | From: Richard O'Grady 3 | Date: Tue, 3 Dec 2024 09:46:23 -0800 4 | Subject: Replace gtest_main with gtest 5 | 6 | gtest_main brings in the main function, which conflicts with 7 | fleetbench main. 8 | --- 9 | scann/scann/restricts/BUILD.bazel | 2 +- 10 | scann/scann/tree_x_hybrid/BUILD.bazel | 2 +- 11 | 2 files changed, 2 insertions(+), 2 deletions(-) 12 | 13 | diff --git a/scann/scann/restricts/BUILD.bazel b/scann/scann/restricts/BUILD.bazel 14 | index 701e14174..fdaee8480 100644 15 | --- a/scann/scann/restricts/BUILD.bazel 16 | +++ b/scann/scann/restricts/BUILD.bazel 17 | @@ -20,6 +20,6 @@ cc_library( 18 | "@com_google_absl//absl/base:core_headers", 19 | "@com_google_absl//absl/log", 20 | "@com_google_absl//absl/log:check", 21 | - "@com_google_googletest//:gtest_main", 22 | + "@com_google_googletest//:gtest", 23 | ], 24 | ) 25 | diff --git a/scann/scann/tree_x_hybrid/BUILD.bazel b/scann/scann/tree_x_hybrid/BUILD.bazel 26 | index c7e8bb519..350a5f6f9 100644 27 | --- a/scann/scann/tree_x_hybrid/BUILD.bazel 28 | +++ b/scann/scann/tree_x_hybrid/BUILD.bazel 29 | @@ -103,7 +103,7 @@ cc_library( 30 | "@com_google_absl//absl/strings", 31 | "@com_google_absl//absl/time", 32 | "@com_google_absl//absl/types:span", 33 | - "@com_google_googletest//:gtest_main", 34 | + "@com_google_googletest//:gtest", 35 | ], 36 | ) 37 | 38 | -- 39 | 2.47.0.338.g60cca15819-goog 40 | 41 | -------------------------------------------------------------------------------- /fleetbench/compression/compression_parameter.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | #ifndef THIRD_PARTY_FLEETBENCH_COMPRESSION_COMPRESSION_PARAMETER_H_ 16 | #define THIRD_PARTY_FLEETBENCH_COMPRESSION_COMPRESSION_PARAMETER_H_ 17 | #include 18 | #include 19 | 20 | #include "absl/container/flat_hash_map.h" 21 | 22 | namespace fleetbench { 23 | namespace compression { 24 | 25 | // The function reads `compression_parameters/compression_levels.csv` file. Each 26 | // entry in the file is in the format "$binary,1,2,3,..." indicating the binary 27 | // and its corresponding compression levels. The function returns a map where 28 | // the binary is the key, and the associated compression levels vector as the 29 | // value. 30 | absl::flat_hash_map > > 32 | GetCompressionLevelsMap(); 33 | 34 | } // namespace compression 35 | } // namespace fleetbench 36 | 37 | #endif // THIRD_PARTY_FLEETBENCH_COMPRESSION_COMPRESSION_PARAMETER_H_ 38 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memcmp_0.csv: -------------------------------------------------------------------------------- 1 | 0:0.00260101,1:5.78001e-05,2:5.78001e-05,3:0.0122536,4:0.00294781,5:0.00809202,6:0.661291,7:0.00630021,8:0.0160684,9:0.0266459,10:0.000578001,11:0.00323681,12:0.0102306,13:0.0109242,14:0.00369921,15:0.0865268,16:0.0304029,17:0.0012138,18:0.0108086,19:0.00913242,20:0.00618461,21:0.00352581,22:0.017629,23:0.00364141,24:0.00878562,25:0.0015028,26:0.0013872,27:0.0017918,28:0.0010982,29:0.0017918,30:0.00953702,31:0.00832322,32:0.000578001,33:0.000231201,34:0.000404601,35:0.000751402,36:0.0109242,37:0.0010404,38:0.000404601,39:0.000346801,40:0.000462401,41:0.000635801,42:0.000751402,43:0.000867002,44:0.0012716,45:0.000982602,46:0.000578001,47:0.000404601,48:0.000346801,49:0.000462401,50:0.000520201,51:0.000520201,52:0.0019074,53:0.000462401,55:0.0001156,57:0.000231201,58:0.001156,59:5.78001e-05,60:5.78001e-05,61:0.0001156,62:0.0001156,63:0.000231201,64:5.78001e-05,65:0.0001156,66:0.000635801,67:5.78001e-05,68:0.000346801,69:5.78001e-05,70:5.78001e-05,71:0.000231201,72:0.0001156,74:0.000578001,77:5.78001e-05,78:0.0001156,79:0.000231201,80:5.78001e-05,85:0.0001156,90:5.78001e-05,91:0.0001156,93:5.78001e-05,95:5.78001e-05,96:5.78001e-05,97:5.78001e-05,98:5.78001e-05,105:5.78001e-05,114:5.78001e-05,117:5.78001e-05,120:5.78001e-05,125:5.78001e-05,126:0.0001156,128:0.0001734,130:5.78001e-05,132:5.78001e-05,138:5.78001e-05,139:5.78001e-05,140:5.78001e-05,146:5.78001e-05,152:5.78001e-05,156:5.78001e-05,165:5.78001e-05,167:5.78001e-05,176:0.0001156,194:5.78001e-05,255:5.78001e-05,283:5.78001e-05,338:5.78001e-05 2 | 0:0.999769,1:0.000231201 3 | 1:0.000289001,2:0.000520201,4:5.78001e-05,8:0.277325,16:0.408647,32:0.183226,64:0.129935 4 | -------------------------------------------------------------------------------- /fleetbench/libc/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 3 | 4 | package(default_visibility = ["//visibility:private"]) 5 | 6 | cc_library( 7 | name = "utils", 8 | srcs = ["utils.cc"], 9 | hdrs = ["utils.h"], 10 | deps = ["@com_google_absl//absl/log:check"], 11 | ) 12 | 13 | cc_library( 14 | name = "mem_benchmark_lib", 15 | testonly = True, 16 | srcs = ["mem_benchmark.cc"], 17 | data = glob( 18 | ["distributions/**"], 19 | ), 20 | visibility = ["//fleetbench:__pkg__"], 21 | deps = [ 22 | ":utils", 23 | "//fleetbench:dynamic_registrar", 24 | "//fleetbench/common", 25 | "@com_google_absl//absl/algorithm:container", 26 | "@com_google_absl//absl/base:no_destructor", 27 | "@com_google_absl//absl/container:btree", 28 | "@com_google_absl//absl/container:flat_hash_map", 29 | "@com_google_absl//absl/log:check", 30 | "@com_google_absl//absl/random:distributions", 31 | "@com_google_absl//absl/strings", 32 | "@com_google_benchmark//:benchmark", 33 | ], 34 | alwayslink = True, 35 | ) 36 | 37 | cc_test( 38 | name = "mem_benchmark", 39 | linkstatic = 1, 40 | malloc = "@com_google_tcmalloc//tcmalloc", 41 | deps = [ 42 | ":mem_benchmark_lib", 43 | "//fleetbench:benchmark_main", 44 | ], 45 | ) 46 | 47 | cc_test( 48 | name = "utils_test", 49 | srcs = ["utils_test.cc"], 50 | deps = [ 51 | ":utils", 52 | "@com_google_absl//absl/types:span", 53 | "@com_google_googletest//:gtest_main", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /fleetbench/compression/generate_corpora/BUILD: -------------------------------------------------------------------------------- 1 | load("@fleetbench_pip_deps//:requirements.bzl", "requirement") 2 | 3 | package(default_visibility = ["//fleetbench:__subpackages__"]) 4 | 5 | py_library( 6 | name = "distribution_tracker", 7 | srcs = ["distribution_tracker.py"], 8 | deps = [ 9 | "@com_google_absl_py//absl/logging", 10 | requirement("numpy"), 11 | ], 12 | ) 13 | 14 | py_test( 15 | name = "distribution_tracker_test", 16 | srcs = ["distribution_tracker_test.py"], 17 | deps = [ 18 | ":distribution_tracker", 19 | "@com_google_absl_py//absl/testing:absltest", 20 | ], 21 | ) 22 | 23 | py_library( 24 | name = "corpus_generator", 25 | srcs = ["corpus_generator.py"], 26 | data = glob(["corpora/**"]), 27 | deps = [ 28 | "@com_google_absl_py//absl/logging", 29 | "@rules_python//python/runfiles", 30 | requirement("brotli"), 31 | requirement("zstandard"), 32 | requirement("python-snappy"), 33 | ], 34 | ) 35 | 36 | py_test( 37 | name = "corpus_generator_test", 38 | srcs = ["corpus_generator_test.py"], 39 | data = glob(["corpora/**"]), 40 | deps = [ 41 | ":corpus_generator", 42 | "@com_google_absl_py//absl/testing:absltest", 43 | "@rules_python//python/runfiles", 44 | requirement("numpy"), 45 | ], 46 | ) 47 | 48 | py_binary( 49 | name = "generate_corpora", 50 | srcs = ["generate_corpora.py"], 51 | deps = [ 52 | ":corpus_generator", 53 | ":distribution_tracker", 54 | "@com_google_absl_py//absl:app", 55 | "@com_google_absl_py//absl/flags", 56 | requirement("numpy"), 57 | ], 58 | ) 59 | -------------------------------------------------------------------------------- /fleetbench/patches/0005-Update-path-to-py_proto_library.patch: -------------------------------------------------------------------------------- 1 | From 1f3b442a5f19f6a861de0df57c75c9aa0c064a3c Mon Sep 17 00:00:00 2001 2 | From: Richard O'Grady 3 | Date: Tue, 29 Jul 2025 10:49:01 -0700 4 | Subject: Update path to py_proto_library 5 | 6 | The py_proto_library in protobuf moved to a bazel/ directory. 7 | Adjust scann_py_proto_library wrapper for changes to the upstream build 8 | rule. 9 | --- 10 | scann/scann/oss_wrappers/build_defs.bzl | 8 ++------ 11 | 1 file changed, 2 insertions(+), 6 deletions(-) 12 | 13 | diff --git a/scann/scann/oss_wrappers/build_defs.bzl b/scann/scann/oss_wrappers/build_defs.bzl 14 | index 5259dd160..825e913df 100644 15 | --- a/scann/scann/oss_wrappers/build_defs.bzl 16 | +++ b/scann/scann/oss_wrappers/build_defs.bzl 17 | @@ -1,6 +1,6 @@ 18 | """.bzl file for ScaNN open source build configs.""" 19 | 20 | -load("@com_google_protobuf//:protobuf.bzl", "py_proto_library") 21 | +load("@com_google_protobuf//bazel:py_proto_library.bzl", "py_proto_library") 22 | 23 | def scann_py_proto_library( 24 | name, 25 | @@ -18,12 +18,8 @@ def scann_py_proto_library( 26 | proto_deps: a list of dependency labels for internal use. 27 | **kwargs: other keyword arguments that are passed to py_proto_library. 28 | """ 29 | - _ignore = [proto_deps] # buildifier: disable=unused-variable 30 | py_proto_library( 31 | name = name, 32 | - srcs = srcs, 33 | - deps = py_proto_deps, 34 | - default_runtime = "@com_google_protobuf//:protobuf_python", 35 | - protoc = "@com_google_protobuf//:protoc", 36 | + deps = proto_deps, 37 | **kwargs 38 | ) 39 | -- 40 | 2.50.1.552.g942d659e1b-goog 41 | 42 | -------------------------------------------------------------------------------- /fleetbench/rpc/rpc_counters.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_RPC_COUNTERS_H_ 16 | #define THIRD_PARTY_FLEETBENCH_RPC_RPC_COUNTERS_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "absl/strings/string_view.h" 23 | #include "absl/synchronization/mutex.h" 24 | 25 | namespace fleetbench::rpc { 26 | 27 | // Log RPC statistics to a file. This class is thread-safe. 28 | class RPCCounters { 29 | public: 30 | explicit RPCCounters(absl::string_view filepath); 31 | ~RPCCounters(); 32 | 33 | // Mark a client RPC as complete, logging it's completion latency and status 34 | void ClientRPCComplete(double latency, bool is_ok); 35 | // Mark a server RPC as complete 36 | void ServerRPCComplete(); 37 | 38 | private: 39 | std::vector client_latency_; 40 | uint64_t client_queries_; 41 | uint64_t client_errors_; 42 | uint64_t server_queries_; 43 | std::ofstream outfile_; 44 | absl::Mutex mtx_; 45 | }; 46 | 47 | } // namespace fleetbench::rpc 48 | 49 | #endif // THIRD_PARTY_FLEETBENCH_RPC_RPC_COUNTERS_H_ 50 | -------------------------------------------------------------------------------- /fleetbench/distro_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 The Fleetbench 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 | # https://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 | from absl.testing import absltest 16 | import brotli 17 | import numpy as np 18 | import pandas as pd 19 | import psutil 20 | import zstandard 21 | 22 | import snappy 23 | 24 | 25 | class DistroTest(absltest.TestCase): 26 | """Sanity check that we can import Python libraries.""" 27 | 28 | def testPsUtil(self): 29 | self.assertGreater(psutil.cpu_count(), 0) 30 | 31 | def testPandas(self): 32 | self.assertTrue(pd.Series([1, 2, 3]).any()) 33 | 34 | def testNumpy(self): 35 | self.assertTrue(np.any(np.array([1, 2, 3]))) 36 | 37 | def testZstd(self): 38 | compressed_bytes = zstandard.compress(b"12345678", level=0) 39 | self.assertEqual(zstandard.decompress(compressed_bytes), b"12345678") 40 | 41 | def testSnappy(self): 42 | compressed_bytes = snappy.compress(b"12345678") 43 | self.assertEqual(snappy.uncompress(compressed_bytes), b"12345678") 44 | 45 | def testBrotli(self): 46 | compressed_bytes = brotli.compress(b"12345678") 47 | self.assertEqual(brotli.decompress(compressed_bytes), b"12345678") 48 | 49 | 50 | if __name__ == "__main__": 51 | absltest.main() 52 | -------------------------------------------------------------------------------- /fleetbench/tcmalloc_copts.bzl: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The Fleetbench 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 | # https://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 | """This package provides default compiler warning flags for the OSS release""" 16 | 17 | TCMALLOC_LLVM_FLAGS = [ 18 | # Ensure TCMalloc itself builds without errors, even if its dependencies 19 | # aren't necessarily -Werror clean. 20 | "-Werror", 21 | "-Wno-deprecated-declarations", 22 | "-Wno-deprecated-volatile", 23 | "-Wno-implicit-int-float-conversion", 24 | "-Wno-sign-compare", 25 | "-Wno-uninitialized", 26 | "-Wno-unused-function", 27 | "-Wno-unused-variable", 28 | ] 29 | 30 | TCMALLOC_GCC_FLAGS = [ 31 | # Ensure TCMalloc itself builds without errors, even if its dependencies 32 | # aren't necessarily -Werror clean. 33 | "-Werror", 34 | "-Wno-attribute-alias", 35 | "-Wno-sign-compare", 36 | "-Wno-stringop-overflow", 37 | "-Wno-uninitialized", 38 | "-Wno-unused-function", 39 | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 40 | "-Wno-unused-result", 41 | "-Wno-unused-variable", 42 | ] 43 | 44 | TCMALLOC_DEFAULT_COPTS = select({ 45 | "//fleetbench:llvm": TCMALLOC_LLVM_FLAGS, 46 | "//conditions:default": TCMALLOC_GCC_FLAGS, 47 | }) 48 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10/request/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P10.request.Message1; 19 | 20 | message Message1 { 21 | optional int64 f_0 = 1; 22 | message M1 { 23 | enum E1 { 24 | E1_UNSPECIFIED = 0; 25 | E1_CONST_1 = 25; 26 | E1_CONST_2 = 114; 27 | E1_CONST_3 = 18; 28 | E1_CONST_4 = 6; 29 | E1_CONST_5 = 86; 30 | } 31 | optional E1 f_0 = 1; 32 | optional int32 f_1 = 2; 33 | optional string f_2 = 4; 34 | optional bytes f_3 = 5; 35 | enum E2 { 36 | E2_UNSPECIFIED = 0; 37 | E2_CONST_1 = 66; 38 | E2_CONST_2 = 5; 39 | E2_CONST_3 = 28; 40 | E2_CONST_4 = 16; 41 | E2_CONST_5 = 58; 42 | } 43 | optional E2 f_4 = 7; 44 | optional int64 f_5 = 8; 45 | optional uint64 f_6 = 11; 46 | optional int64 f_7 = 14; 47 | optional int64 f_8 = 17; 48 | optional int64 f_9 = 20; 49 | repeated string f_10 = 23; 50 | optional string f_11 = 26; 51 | optional bool f_12 = 27; 52 | optional int64 f_13 = 29; 53 | } 54 | repeated M1 f_2 = 2; 55 | } 56 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9/response/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P9.response.Message1; 19 | 20 | message Message1 { 21 | optional fixed32 f_0 = 3; 22 | message M1 { 23 | enum E1 { 24 | E1_UNSPECIFIED = 0; 25 | E1_CONST_1 = 20; 26 | E1_CONST_2 = 27; 27 | E1_CONST_3 = 76; 28 | E1_CONST_4 = 5; 29 | E1_CONST_5 = 97; 30 | } 31 | optional E1 f_0 = 3; 32 | message M2 { 33 | enum E2 { 34 | E2_UNSPECIFIED = 0; 35 | E2_CONST_1 = 92; 36 | E2_CONST_2 = 105; 37 | E2_CONST_3 = 61; 38 | E2_CONST_4 = 69; 39 | E2_CONST_5 = 82; 40 | } 41 | optional E2 f_0 = 2; 42 | message M3 { 43 | optional uint64 f_0 = 2; 44 | message M4 { 45 | optional int64 f_0 = 2; 46 | } 47 | optional M4 f_7 = 7; 48 | message M5 { 49 | optional fixed32 f_0 = 6; 50 | } 51 | repeated M5 f_9 = 9; 52 | } 53 | optional M3 f_4 = 4; 54 | } 55 | repeated M2 f_6 = 6; 56 | } 57 | optional M1 f_5 = 5; 58 | } 59 | -------------------------------------------------------------------------------- /fleetbench/rpc/util.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_UTIL_H_ 16 | #define THIRD_PARTY_FLEETBENCH_RPC_UTIL_H_ 17 | 18 | #include "absl/status/status.h" 19 | #include "absl/strings/string_view.h" 20 | #include "google/protobuf/message.h" 21 | 22 | namespace fleetbench::rpc { 23 | 24 | // Parse a protocol buffer message passed in as "arg_spec" into the message 25 | // pointed to by "parsed". 26 | // 27 | // "arg_spec" may be either: 28 | // 1. A text-proto string describing a protobuf message, 29 | // 2. A filename containing a text-proto formatted protobuf message, 30 | // 3. A filename containing a binary formatted protobuf message. 31 | // 32 | // It is expected that the format of the protobuf in "arg_spec" matches the 33 | // underlying concrete type of "parsed". 34 | // 35 | // "what" is used as an identifying string for more informative log and error 36 | // messages - it is the type and/or reason we're parsing this protobuf. 37 | absl::Status ParseProto(google::protobuf::Message* parsed, absl::string_view arg_spec, 38 | absl::string_view what); 39 | 40 | } // namespace fleetbench::rpc 41 | 42 | #endif // THIRD_PARTY_FLEETBENCH_RPC_UTIL_H_ 43 | -------------------------------------------------------------------------------- /fleetbench/simd/tensorflow_support/tensorflow/core/lib/core/threadpool.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_H_ 16 | #define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_H_ 17 | 18 | #include 19 | #include 20 | 21 | // Minimal subset of tensorflow threadpool needed for Fleetbench and its 22 | // dependencies (ScaNN). Note this code doesn't do anything, it's merely 23 | // a placeholder to allow the rest of the code to compile. 24 | 25 | namespace tensorflow { 26 | class Env { 27 | public: 28 | static Env* Default(); 29 | }; 30 | 31 | struct ThreadOptions { 32 | int stack_size = 0; 33 | }; 34 | 35 | namespace thread { 36 | 37 | class ThreadPool { 38 | public: 39 | ThreadPool(const Env* env, const ThreadOptions& options, 40 | const std::string& name_prefix, int num_threads) 41 | : num_threads_(num_threads) {} 42 | 43 | int NumThreads() const { return num_threads_; } 44 | // Schedules fn() for execution in the pool of threads. 45 | void Schedule(std::function fn) {} 46 | 47 | private: 48 | int num_threads_; 49 | }; 50 | 51 | } // namespace thread 52 | } // namespace tensorflow 53 | 54 | #endif // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_H_ 55 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9/request/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P9.request.Message1; 19 | 20 | message Message1 { 21 | optional uint64 f_0 = 4; 22 | message M1 { 23 | optional int64 f_0 = 1; 24 | optional int64 f_1 = 3; 25 | optional fixed32 f_2 = 6; 26 | optional fixed32 f_3 = 8; 27 | optional bytes f_4 = 11; 28 | message M2 { 29 | optional int64 f_0 = 3; 30 | enum E1 { 31 | E1_UNSPECIFIED = 0; 32 | E1_CONST_1 = 34; 33 | E1_CONST_2 = 1; 34 | E1_CONST_3 = 58; 35 | E1_CONST_4 = 36; 36 | E1_CONST_5 = 24; 37 | } 38 | optional E1 f_1 = 5; 39 | message M3 { 40 | optional int64 f_0 = 3; 41 | optional fixed32 f_1 = 6; 42 | optional fixed32 f_2 = 9; 43 | message M4 { 44 | optional fixed32 f_0 = 2; 45 | message M5 { 46 | optional fixed32 f_0 = 4; 47 | } 48 | optional M5 f_3 = 3; 49 | } 50 | repeated M4 f_10 = 10; 51 | } 52 | repeated M3 f_6 = 6; 53 | } 54 | repeated M2 f_13 = 13; 55 | } 56 | optional M1 f_6 = 6; 57 | } 58 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memset_0.csv: -------------------------------------------------------------------------------- 1 | 0:0.00115397,1:0.000164853,4:0.127926,8:0.0275305,10:0.000164853,12:0.00329707,13:0.000329707,16:0.172931,17:0.0182987,18:0.000329707,19:0.262117,20:0.00098912,23:0.0296736,24:0.0252226,28:0.00098912,31:0.085394,32:0.0214309,36:0.000164853,40:0.00230795,44:0.000164853,47:0.0367623,48:0.0211012,52:0.000329707,56:0.00230795,60:0.000164853,64:0.0102209,68:0.000164853,70:0.000329707,72:0.00395648,79:0.034784,80:0.00197824,88:0.000824266,96:0.00214309,104:0.00923178,106:0.00263765,108:0.000164853,112:0.00214309,120:0.00049456,128:0.00313221,132:0.000164853,136:0.000659413,143:0.0153314,144:0.000329707,148:0.000164853,152:0.00049456,160:0.00115397,168:0.000329707,172:0.000164853,176:0.000329707,192:0.000164853,208:0.000164853,220:0.000329707,224:0.00164853,232:0.000329707,256:0.00131883,271:0.0133531,272:0.0024728,280:0.000329707,288:0.000164853,296:0.000164853,304:0.00049456,312:0.000164853,313:0.000824266,320:0.00164853,332:0.000164853,352:0.00049456,392:0.000824266,400:0.00675898,436:0.000164853,444:0.000329707,472:0.00049456,480:0.00049456,496:0.000164853,508:0.00049456,512:0.00313221,526:0.00230795,544:0.000329707,568:0.000164853,576:0.000329707,584:0.00049456,640:0.00049456,670:0.00049456,703:0.000329707,736:0.000164853,766:0.000164853,832:0.000164853,847:0.00115397,895:0.000164853,958:0.000164853,1006:0.00164853,1026:0.00197824,1046:0.000164853,1110:0.000824266,1294:0.000164853,1577:0.000164853,1772:0.000824266,1974:0.00098912,2062:0.00049456,2416:0.00313221,2504:0.00824266,3500:0.000164853,4027:0.000329707,4091:0.000329707,4107:0.000329707,4187:0.000164853,4422:0.000164853,4724:0.000164853,4742:0.000329707,7144:0.000164853,7228:0.000164853,8188:0.000164853,8886:0.00049456,8921:0.000329707,16393:0.00049456,19923:0.000164853,21123:0.000164853,39875:0.000164853,65426:0.000329707,79823:0.000164853 2 | 0:1 3 | 2:0.000164853,4:0.016815,8:0.674744,16:0.108803,32:0.0684141,64:0.131058 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3/response/Message2.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P3.response.Message2; 19 | 20 | message Message2 { 21 | optional string f_0 = 1; 22 | message M1 { 23 | optional int64 f_0 = 1; 24 | } 25 | optional M1 f_3 = 3; 26 | message M2 { 27 | optional int64 f_0 = 2; 28 | optional uint64 f_1 = 4; 29 | } 30 | repeated M2 f_4 = 4; 31 | message M3 { 32 | enum E1 { 33 | E1_UNSPECIFIED = 0; 34 | E1_CONST_1 = 40; 35 | E1_CONST_2 = 11; 36 | E1_CONST_3 = 94; 37 | E1_CONST_4 = 82; 38 | E1_CONST_5 = 55; 39 | } 40 | optional E1 f_0 = 2; 41 | optional string f_1 = 3; 42 | enum E2 { 43 | E2_UNSPECIFIED = 0; 44 | E2_CONST_1 = 113; 45 | E2_CONST_2 = 72; 46 | E2_CONST_3 = 49; 47 | E2_CONST_4 = 40; 48 | E2_CONST_5 = 87; 49 | } 50 | optional E2 f_2 = 4; 51 | optional double f_3 = 5; 52 | enum E3 { 53 | E3_UNSPECIFIED = 0; 54 | E3_CONST_1 = 72; 55 | E3_CONST_2 = 59; 56 | E3_CONST_3 = 113; 57 | E3_CONST_4 = 9; 58 | E3_CONST_5 = 62; 59 | } 60 | optional E3 f_4 = 6; 61 | } 62 | optional M3 f_5 = 5; 63 | } 64 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/RequestMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P0RequestMessage.proto"; 24 | import "fleetbench/rpc/protos/P10RequestMessage.proto"; 25 | import "fleetbench/rpc/protos/P1RequestMessage.proto"; 26 | import "fleetbench/rpc/protos/P2RequestMessage.proto"; 27 | import "fleetbench/rpc/protos/P3RequestMessage.proto"; 28 | import "fleetbench/rpc/protos/P4RequestMessage.proto"; 29 | import "fleetbench/rpc/protos/P5RequestMessage.proto"; 30 | import "fleetbench/rpc/protos/P6RequestMessage.proto"; 31 | import "fleetbench/rpc/protos/P7RequestMessage.proto"; 32 | import "fleetbench/rpc/protos/P8RequestMessage.proto"; 33 | import "fleetbench/rpc/protos/P9RequestMessage.proto"; 34 | 35 | message RequestMessage { 36 | oneof msg { 37 | P0RequestMessage p0 = 1; 38 | P1RequestMessage p1 = 2; 39 | P2RequestMessage p2 = 3; 40 | P3RequestMessage p3 = 4; 41 | P4RequestMessage p4 = 5; 42 | P5RequestMessage p5 = 6; 43 | P6RequestMessage p6 = 7; 44 | P7RequestMessage p7 = 8; 45 | P8RequestMessage p8 = 9; 46 | P9RequestMessage p9 = 10; 47 | P10RequestMessage p10 = 11; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /fleetbench/swissmap/swissmap_benchmark_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Fleetbench 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 | // https://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 | // This file defines the skeleton of generated benchmark files. It contains 15 | // the includes, gunit benchmark code, and main entrypoint. 16 | 17 | #include "fleetbench/swissmap/swissmap_benchmark.h" 18 | 19 | #include "gtest/gtest.h" 20 | #include "absl/container/flat_hash_set.h" 21 | 22 | namespace fleetbench { 23 | 24 | TEST(SwissmapBenchmarkTest, Density) { 25 | auto set1 = GenerateSet, Hash, Eq>>( 26 | 1 << 10, Density::kMin); 27 | EXPECT_LT(set1.load_factor(), 0.5); 28 | 29 | auto set2 = GenerateSet, Hash, Eq>>( 30 | 1 << 10, Density::kMax); 31 | EXPECT_GT(set2.load_factor(), 0.8); 32 | } 33 | 34 | TEST(SwissmapBenchmarkTest, GenerateSets) { 35 | auto sets = GenerateSets, Hash, Eq>>( 36 | 1, 3, Density::kMin); 37 | EXPECT_EQ(sets.size(), 2); 38 | 39 | int num_elements = 0; 40 | for (auto s : sets) { 41 | EXPECT_GE(s.size(), 1); 42 | EXPECT_EQ(s.size(), ToVector(s).size()); 43 | num_elements += s.size(); 44 | } 45 | 46 | auto v = ToVectorRandomized(sets); 47 | EXPECT_EQ(v.size(), sets.size()); 48 | EXPECT_EQ(Transpose(v).size(), num_elements); 49 | } 50 | } // namespace fleetbench 51 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/ResponseMessage.proto: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | syntax = "proto2"; 20 | 21 | package fleetbench.rpc; 22 | 23 | import "fleetbench/rpc/protos/P0ResponseMessage.proto"; 24 | import "fleetbench/rpc/protos/P10ResponseMessage.proto"; 25 | import "fleetbench/rpc/protos/P1ResponseMessage.proto"; 26 | import "fleetbench/rpc/protos/P2ResponseMessage.proto"; 27 | import "fleetbench/rpc/protos/P3ResponseMessage.proto"; 28 | import "fleetbench/rpc/protos/P4ResponseMessage.proto"; 29 | import "fleetbench/rpc/protos/P5ResponseMessage.proto"; 30 | import "fleetbench/rpc/protos/P6ResponseMessage.proto"; 31 | import "fleetbench/rpc/protos/P7ResponseMessage.proto"; 32 | import "fleetbench/rpc/protos/P8ResponseMessage.proto"; 33 | import "fleetbench/rpc/protos/P9ResponseMessage.proto"; 34 | 35 | message ResponseMessage { 36 | oneof msg { 37 | P0ResponseMessage p0 = 1; 38 | P1ResponseMessage p1 = 2; 39 | P2ResponseMessage p2 = 3; 40 | P3ResponseMessage p3 = 4; 41 | P4ResponseMessage p4 = 5; 42 | P5ResponseMessage p5 = 6; 43 | P6ResponseMessage p6 = 7; 44 | P7ResponseMessage p7 = 8; 45 | P8ResponseMessage p8 = 9; 46 | P9ResponseMessage p9 = 10; 47 | P10ResponseMessage p10 = 11; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_8.csv: -------------------------------------------------------------------------------- 1 | 0:0.00303022,1:0.0252345,2:0.0269324,3:0.0565555,4:0.17348,5:0.140278,6:0.175544,7:0.0232753,8:0.0838797,9:0.0176589,10:0.0216034,11:0.0147593,12:0.02769,13:0.0118858,14:0.0149683,15:0.0139756,16:0.0120425,17:0.0123038,18:0.0175022,19:0.00815026,20:0.00592983,21:0.00705311,22:0.0102662,23:0.0071576,24:0.00673964,25:0.0087772,26:0.00650453,27:0.00483268,28:0.00389227,29:0.00368329,30:0.00410125,31:0.00198532,32:0.00305635,33:0.00224655,34:0.00128001,35:0.00587759,36:0.00148899,37:0.00185471,38:0.00154123,39:0.002769,40:0.00120164,41:0.002769,42:0.00164573,43:0.00188083,44:0.00109715,45:0.000835924,46:0.00193307,47:0.00101878,48:0.0019592,49:0.00109715,50:0.000809801,51:0.00128001,52:0.000417962,53:0.000156736,54:0.000574698,55:0.000888169,56:0.000339594,57:0.000287349,58:0.000208981,59:0.000261226,60:0.000470207,61:0.000130613,62:0.000156736,63:0.000287349,64:2.61226e-05,65:5.22452e-05,66:0.000156736,67:7.83679e-05,68:0.00010449,70:2.61226e-05,71:0.000287349,72:0.000182858,73:0.0016196,74:0.000130613,75:0.000391839,76:0.000731433,77:0.000182858,78:2.61226e-05,79:0.00010449,80:2.61226e-05,83:2.61226e-05,84:5.22452e-05,85:0.000130613,86:5.22452e-05,87:2.61226e-05,88:0.00010449,89:0.00010449,90:5.22452e-05,91:0.000235104,93:2.61226e-05,95:7.83679e-05,97:2.61226e-05,98:2.61226e-05,100:5.22452e-05,101:2.61226e-05,102:2.61226e-05,103:0.000287349,105:5.22452e-05,106:5.22452e-05,108:5.22452e-05,109:2.61226e-05,110:5.22452e-05,113:2.61226e-05,119:5.22452e-05,121:2.61226e-05,122:2.61226e-05,123:2.61226e-05,127:2.61226e-05,130:2.61226e-05,131:2.61226e-05,133:2.61226e-05,145:2.61226e-05,146:5.22452e-05,147:7.83679e-05,153:2.61226e-05,155:7.83679e-05,156:2.61226e-05,159:2.61226e-05,160:2.61226e-05,161:2.61226e-05,165:2.61226e-05,175:2.61226e-05,181:2.61226e-05,195:2.61226e-05,355:2.61226e-05,360:2.61226e-05,562:2.61226e-05 2 | 0:0.833207,1:0.166793 3 | 1:0.0690421,2:0.0358141,4:0.0378517,8:0.310154,16:0.206395,32:0.114913,64:0.22583 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/rpcperf.h: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_RPCPERF_H_ 16 | #define THIRD_PARTY_FLEETBENCH_RPC_RPCPERF_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "absl/strings/string_view.h" 25 | #include "fleetbench/rpc/grpc_client.h" 26 | #include "fleetbench/rpc/grpc_server.h" 27 | 28 | namespace fleetbench::rpc { 29 | 30 | std::unique_ptr CreateAndStartServer( 31 | std::vector ports, int32_t workers, bool compress, 32 | bool checksum, std::string logstats_output_path, 33 | std::string resp_delay_us_dist, absl::string_view program, 34 | std::vector* selected_ports = nullptr); 35 | 36 | std::unique_ptr CreateAndStartClient( 37 | int32_t max_outstanding_rpcs, bool compress, bool checksum, 38 | bool skip_loopback, std::vector peers, int32_t max_peers, 39 | int32_t connections_per_peer, std::string logstats_output_path, 40 | std::string req_delay_us_dist, absl::string_view program, 41 | std::function keep_running); 42 | 43 | void Wait(std::unique_ptr server, 44 | std::unique_ptr client); 45 | 46 | } // namespace fleetbench::rpc 47 | 48 | #endif // THIRD_PARTY_FLEETBENCH_RPC_RPCPERF_H_ 49 | -------------------------------------------------------------------------------- /fleetbench/parallel/worker_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 The Fleetbench 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 | # https://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 | import os 16 | from unittest import mock 17 | from absl.testing import absltest 18 | from fleetbench.parallel import worker 19 | 20 | 21 | class WorkerTest(absltest.TestCase): 22 | 23 | def testWorkerExecutes(self): 24 | w = worker.Worker(cpu=1, affinity=False) 25 | w.start() 26 | run = mock.MagicMock() 27 | fake_result = mock.MagicMock() 28 | run.Execute.return_value = fake_result 29 | w.TryAddRun(run, []) 30 | results = w.StopAndGetResults() 31 | run.Execute.assert_called_once() 32 | self.assertEqual(results, [fake_result]) 33 | 34 | @mock.patch.object(os, "sched_setaffinity", autospec=True) 35 | def testWorkerExecutesWithExtraWorkers(self, mock_sched_setaffinity): 36 | w = worker.Worker(cpu=1, affinity=True) 37 | w2 = worker.Worker(cpu=2, affinity=True) 38 | w.start() 39 | w2.start() 40 | self.assertTrue(w2.TryBlock()) 41 | run = mock.MagicMock() 42 | fake_result = mock.MagicMock() 43 | run.Execute.return_value = fake_result 44 | w.TryAddRun(run, [w2]) 45 | results = w.StopAndGetResults() 46 | run.Execute.assert_called_once() 47 | self.assertEqual(results, [fake_result]) 48 | self.assertEmpty(w2.StopAndGetResults()) 49 | mock_sched_setaffinity.assert_called() 50 | 51 | 52 | if __name__ == "__main__": 53 | absltest.main() 54 | -------------------------------------------------------------------------------- /fleetbench/swissmap/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 2 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 3 | 4 | package(default_visibility = ["//visibility:private"]) 5 | 6 | cc_library( 7 | name = "swissmap_benchmark_lib", 8 | testonly = True, 9 | srcs = [ 10 | "cold_swissmap_benchmark.cc", 11 | "hot_swissmap_benchmark.cc", 12 | ], 13 | hdrs = [ 14 | "swissmap_benchmark.h", 15 | ], 16 | visibility = ["//fleetbench:__pkg__"], 17 | deps = [ 18 | "//fleetbench:dynamic_registrar", 19 | "//fleetbench/common", 20 | "@com_google_absl//absl/base:core_headers", 21 | "@com_google_absl//absl/container:flat_hash_map", 22 | "@com_google_absl//absl/container:flat_hash_set", 23 | "@com_google_absl//absl/container:node_hash_set", 24 | "@com_google_absl//absl/random", 25 | "@com_google_absl//absl/strings:string_view", 26 | "@com_google_benchmark//:benchmark", 27 | ], 28 | alwayslink = True, 29 | ) 30 | 31 | cc_test( 32 | name = "swissmap_benchmark_test", 33 | srcs = ["swissmap_benchmark_test.cc"], 34 | deps = [ 35 | ":swissmap_benchmark_lib", 36 | "@com_google_absl//absl/container:flat_hash_set", 37 | "@com_google_googletest//:gtest_main", 38 | ], 39 | ) 40 | 41 | cc_test( 42 | name = "swissmap_benchmark", 43 | linkstatic = 1, 44 | malloc = "@com_google_tcmalloc//tcmalloc", 45 | tags = ["manual"], 46 | deps = [ 47 | ":swissmap_benchmark_lib", 48 | "//fleetbench:benchmark_main", 49 | ], 50 | ) 51 | 52 | cc_test( 53 | name = "swissmap_smoketest", 54 | # Just run a single benchmark to reduce the test runtime. 55 | args = ["--benchmark_filter=BM_.*::absl::flat_hash_set.*64.*set_size:64.*density:0"], 56 | malloc = "@com_google_tcmalloc//tcmalloc", 57 | deps = [ 58 | ":swissmap_benchmark_lib", 59 | "//fleetbench:benchmark_main", 60 | ], 61 | ) 62 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Bcmp_2.csv: -------------------------------------------------------------------------------- 1 | 0:0.00188006,1:4.27287e-05,2:0.0186083,3:0.026214,4:0.0283291,5:0.0405709,6:0.0503771,7:0.112056,8:0.0576837,9:0.0749033,10:0.0658662,11:0.0644134,12:0.0126263,13:0.0242485,14:0.0104685,15:0.0284573,16:0.0113017,17:0.0615079,18:0.0058111,19:0.00380285,20:0.00615293,21:0.00450787,22:0.0186938,23:0.0111735,24:0.0513812,25:0.00459333,26:0.00664431,27:0.0128827,28:0.011729,29:0.00600338,30:0.0255304,31:0.00662294,32:0.0249749,33:0.00461469,34:0.00382421,35:0.0115795,36:0.00294828,37:0.00517017,38:0.00115367,39:0.0143782,40:0.00382421,41:0.00482834,42:0.0414254,43:0.000875937,44:0.0014955,45:0.00121777,46:0.00113231,47:0.000405922,48:0.00134595,49:0.000769116,50:0.000470015,51:0.000320465,52:0.000427287,53:0.000192279,54:0.000128186,55:0.000341829,56:0.000170915,57:0.000555472,58:8.54573e-05,59:0.000106822,60:6.4093e-05,61:8.54573e-05,62:6.4093e-05,63:2.13643e-05,66:2.13643e-05,67:2.13643e-05,69:4.27287e-05,70:2.13643e-05,73:6.4093e-05,74:2.13643e-05,76:0.000299101,78:2.13643e-05,80:0.000256372,82:6.4093e-05,83:2.13643e-05,84:4.27287e-05,85:0.000213643,86:0.000235008,87:2.13643e-05,88:0.000491379,89:0.000106822,90:0.000170915,91:2.13643e-05,92:2.13643e-05,93:0.000534108,94:0.000341829,95:0.000128186,96:2.13643e-05,100:2.13643e-05,101:0.000128186,102:4.27287e-05,106:2.13643e-05,107:2.13643e-05,108:6.4093e-05,109:2.13643e-05,111:2.13643e-05,113:2.13643e-05,114:4.27287e-05,115:2.13643e-05,119:4.27287e-05,121:2.13643e-05,126:2.13643e-05,148:2.13643e-05,396:2.13643e-05,508:2.13643e-05,514:2.13643e-05,564:4.27287e-05,566:6.4093e-05,568:6.4093e-05,570:0.000192279,572:0.000192279,574:8.54573e-05,588:2.13643e-05,602:2.13643e-05,604:2.13643e-05,608:2.13643e-05,618:2.13643e-05,624:2.13643e-05,626:2.13643e-05,649:2.13643e-05,658:2.13643e-05,664:2.13643e-05,667:2.13643e-05,670:8.54573e-05,685:2.13643e-05,730:2.13643e-05,757:2.13643e-05,802:2.13643e-05,1090:0.00104685,4091:2.13643e-05 2 | 0:0.994039,1:0.00596065 3 | 1:0.170722,2:0.0763775,4:0.0493302,8:0.15581,16:0.266563,32:0.121392,64:0.159805 4 | -------------------------------------------------------------------------------- /fleetbench/rpc/rpc_counters.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Fleetbench 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 | // https://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 | #include "fleetbench/rpc/rpc_counters.h" 16 | 17 | #include 18 | #include 19 | 20 | #include "absl/log/log.h" 21 | #include "absl/strings/str_join.h" 22 | #include "absl/strings/string_view.h" 23 | #include "absl/synchronization/mutex.h" 24 | 25 | namespace fleetbench::rpc { 26 | 27 | RPCCounters::RPCCounters(absl::string_view filepath) 28 | : client_queries_(0), client_errors_(0), server_queries_(0) { 29 | if (filepath.empty()) { 30 | LOG(FATAL) << "No filepath provided"; 31 | } 32 | outfile_.open(std::string(filepath), std::ios::out); 33 | if (!outfile_.is_open()) { 34 | LOG(FATAL) << "Unable to open " << filepath << " for writing"; 35 | } 36 | } 37 | 38 | RPCCounters::~RPCCounters() { 39 | outfile_ << "TotalClientRPCs: " << client_queries_ << "\n"; 40 | outfile_ << "TotalClientErrors: " << client_errors_ << "\n"; 41 | outfile_ << "SampleClientLatencies: " << absl::StrJoin(client_latency_, ",") 42 | << "\n"; 43 | outfile_ << "TotalServerQueries: " << server_queries_ << "\n"; 44 | outfile_.flush(); 45 | outfile_.close(); 46 | } 47 | 48 | void RPCCounters::ClientRPCComplete(double latency, bool is_ok) { 49 | absl::MutexLock l(&mtx_); 50 | ++client_queries_; 51 | if (!is_ok) ++client_errors_; 52 | client_latency_.push_back(latency); 53 | } 54 | 55 | void RPCCounters::ServerRPCComplete() { 56 | absl::MutexLock l(&mtx_); 57 | ++server_queries_; 58 | } 59 | 60 | } // namespace fleetbench::rpc 61 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1/request/Message1.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | syntax = "proto2"; 17 | 18 | package fleetbench.rpc.P1.request.Message1; 19 | 20 | message Message1 { 21 | optional bool f_0 = 1; 22 | enum E1 { 23 | E1_UNSPECIFIED = 0; 24 | E1_CONST_1 = 45; 25 | E1_CONST_2 = 96; 26 | E1_CONST_3 = 44; 27 | E1_CONST_4 = 80; 28 | E1_CONST_5 = 4; 29 | } 30 | optional E1 f_1 = 2; 31 | optional bool f_2 = 3; 32 | message M1 { 33 | optional int32 f_0 = 1; 34 | message M5 { 35 | optional int32 f_0 = 1; 36 | optional int32 f_1 = 2; 37 | optional int64 f_2 = 4; 38 | optional int64 f_3 = 6; 39 | message M6 { 40 | optional bytes f_0 = 1; 41 | optional bool f_1 = 2; 42 | } 43 | optional M6 f_7 = 7; 44 | } 45 | optional M5 f_2 = 2; 46 | } 47 | repeated M1 f_5 = 5; 48 | message M2 { 49 | optional bool f_0 = 2; 50 | } 51 | optional M2 f_7 = 7; 52 | message M3 { 53 | optional fixed32 f_0 = 1; 54 | optional string f_1 = 2; 55 | } 56 | repeated M3 f_8 = 8; 57 | message M4 { 58 | optional int64 f_0 = 1; 59 | enum E2 { 60 | E2_UNSPECIFIED = 0; 61 | E2_CONST_1 = 44; 62 | E2_CONST_2 = 69; 63 | E2_CONST_3 = 60; 64 | E2_CONST_4 = 1; 65 | E2_CONST_5 = 49; 66 | } 67 | optional E2 f_1 = 2; 68 | optional fixed32 f_2 = 3; 69 | optional bool f_3 = 4; 70 | } 71 | optional M4 f_9 = 9; 72 | } 73 | -------------------------------------------------------------------------------- /fleetbench/libc/distributions/Memset_1.csv: -------------------------------------------------------------------------------- 1 | 1:0.0236977,2:0.00480082,3:0.00081716,4:0.375485,5:0.00081716,6:0.0290092,7:0.00040858,8:0.0944842,9:0.000102145,10:0.000510725,11:0.000102145,12:0.00245148,13:0.000102145,15:0.00020429,16:0.113892,17:0.0278856,19:0.0288049,20:0.00061287,23:0.0092952,24:0.0110317,31:0.000715015,32:0.0336057,36:0.000919305,37:0.000102145,39:0.00020429,40:0.0120531,44:0.00040858,47:0.00337079,48:0.0170582,52:0.0575077,56:0.00081716,59:0.00020429,60:0.000102145,64:0.0114402,72:0.0110317,79:0.00255363,80:0.00265577,88:0.0011236,96:0.00572012,104:0.00674157,106:0.00602656,112:0.00122574,120:0.000306435,128:0.00132789,136:0.00020429,143:0.00286006,144:0.000306435,152:0.000102145,156:0.000715015,160:0.00061287,164:0.000102145,167:0.000102145,184:0.000102145,189:0.000102145,192:0.00224719,200:0.000102145,208:0.000715015,216:0.000102145,224:0.00122574,232:0.00020429,236:0.000102145,240:0.00020429,248:0.000102145,256:0.00173647,260:0.000306435,264:0.00490296,271:0.000102145,272:0.000510725,280:0.000510725,288:0.00061287,296:0.000510725,304:0.0278856,312:0.000102145,320:0.000510725,328:0.000102145,333:0.000102145,334:0.000102145,344:0.00715015,350:0.000306435,352:0.00020429,360:0.000102145,364:0.000102145,368:0.00020429,384:0.00061287,408:0.00020429,416:0.00061287,424:0.000102145,432:0.000715015,448:0.018284,480:0.000102145,496:0.000102145,504:0.00081716,512:0.00459653,520:0.00081716,522:0.000102145,526:0.00020429,544:0.000102145,560:0.00020429,572:0.000102145,576:0.00020429,592:0.0011236,610:0.000102145,670:0.000102145,676:0.000102145,679:0.000102145,688:0.00061287,703:0.00020429,736:0.000102145,766:0.000102145,790:0.00020429,832:0.00020429,895:0.000102145,958:0.00020429,990:0.000102145,1022:0.000306435,1030:0.000510725,1038:0.000102145,1054:0.000102145,1086:0.000102145,1214:0.000102145,1244:0.00020429,1309:0.000102145,1344:0.00020429,1364:0.000510725,1469:0.000102145,1499:0.000102145,1559:0.000102145,1821:0.00081716,1974:0.00224719,2126:0.00122574,2182:0.000306435,2815:0.00040858,4091:0.0011236,4856:0.00040858,32685:0.00020429,65426:0.0011236,130965:0.000102145,261126:0.00020429 2 | 0:1 3 | 1:0.0310489,2:0.0225717,4:0.0107241,8:0.399346,16:0.214993,32:0.126749,64:0.194566 4 | -------------------------------------------------------------------------------- /ci/linux_gcc-latest_libstdcxx_bazel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2022 The Fleetbench Authors. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # This script that can be invoked to test fleetbench in a hermetic environment 18 | # using a Docker image on Linux. You must have Docker installed to use this 19 | # script. 20 | 21 | set -euox pipefail 22 | 23 | if [ -z ${FLEETBENCH_ROOT:-} ]; then 24 | FLEETBENCH_ROOT="$(realpath $(dirname ${0})/..)" 25 | fi 26 | 27 | readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20250527" 28 | 29 | # USE_BAZEL_CACHE=1 only works on Kokoro. 30 | # Without access to the credentials this won't work. 31 | if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then 32 | DOCKER_EXTRA_ARGS="--volume=${KOKORO_KEYSTORE_DIR}:/keystore:ro ${DOCKER_EXTRA_ARGS:-}" 33 | # Bazel doesn't track changes to tools outside of the workspace 34 | # (e.g. /usr/bin/gcc), so by appending the docker container to the 35 | # remote_http_cache url, we make changes to the container part of 36 | # the cache key. Hashing the key is to make it shorter and url-safe. 37 | container_key=$(echo ${DOCKER_CONTAINER} | sha256sum | head -c 16) 38 | BAZEL_EXTRA_ARGS="--remote_http_cache=https://storage.googleapis.com/absl-bazel-remote-cache/${container_key} --google_credentials=/keystore/73103_absl-bazel-remote-cache ${BAZEL_EXTRA_ARGS:-}" 39 | fi 40 | 41 | source "${FLEETBENCH_ROOT}/ci/common.sh" 42 | 43 | start_docker_container 44 | sanity_check_docker_container 45 | 46 | for std in ${STD}; do 47 | run_generic_tests \ 48 | "-e CC=/usr/local/bin/gcc -e BAZEL_CXXOPTS=-std=${std}" \ 49 | "" 50 | done 51 | -------------------------------------------------------------------------------- /fleetbench/simd/BUILD: -------------------------------------------------------------------------------- 1 | """ 2 | Copyright 2024 The Fleetbench Authors 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License" ); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an " AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | """ 16 | 17 | load("@rules_cc//cc:cc_library.bzl", "cc_library") 18 | load("@rules_cc//cc:cc_test.bzl", "cc_test") 19 | load("//fleetbench:utils.bzl", "if_clang") 20 | 21 | package(default_visibility = ["//visibility:private"]) 22 | 23 | cc_library( 24 | name = "simd_library", 25 | testonly = True, 26 | srcs = if_clang([ 27 | "simd_benchmark.cc", 28 | ]), 29 | visibility = ["//fleetbench:__pkg__"], 30 | deps = if_clang([ 31 | "@com_google_research_scann//scann/hashes/internal:lut16_args", 32 | "@com_google_research_scann//scann/hashes/internal:lut16_interface", 33 | "@com_google_research_scann//scann/utils:alignment", 34 | "@com_google_research_scann//scann/utils:common", 35 | "@com_google_research_scann//scann/utils:fast_top_neighbors", 36 | "@com_google_research_scann//scann/utils:threads", 37 | "@com_google_research_scann//scann/utils/intrinsics:flags", 38 | "@com_google_absl//absl/random:distributions", 39 | "@com_google_absl//absl/strings", 40 | "@com_google_absl//absl/types:span", 41 | "@com_google_benchmark//:benchmark", 42 | "//fleetbench:dynamic_registrar", 43 | "//fleetbench/common", 44 | ]), 45 | alwayslink = 1, 46 | ) 47 | 48 | cc_test( 49 | name = "simd_benchmark", 50 | linkstatic = 1, 51 | malloc = "@com_google_tcmalloc//tcmalloc", 52 | visibility = ["//fleetbench:__pkg__"], 53 | deps = [ 54 | ":simd_library", 55 | "//fleetbench:benchmark_main", 56 | ], 57 | ) 58 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P0/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P0/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P0/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P0RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP0RequestMessageMaxMessages = 3; 33 | 34 | inline void P0RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P0RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP0RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P0::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P0::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P0::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P1/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P1/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P1/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P1RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP1RequestMessageMaxMessages = 3; 33 | 34 | inline void P1RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P1RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP1RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P1::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P1::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P1::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P2RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P2/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P2/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P2/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P2RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP2RequestMessageMaxMessages = 3; 33 | 34 | inline void P2RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P2RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP2RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P2::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P2::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P2::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P3/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P3/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P3/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P3RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP3RequestMessageMaxMessages = 3; 33 | 34 | inline void P3RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P3RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP3RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P3::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P3::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P3::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P4/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P4/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P4/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P4RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP4RequestMessageMaxMessages = 3; 33 | 34 | inline void P4RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P4RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP4RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P4::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P4::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P4::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P5RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P5/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P5/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P5/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P5RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP5RequestMessageMaxMessages = 3; 33 | 34 | inline void P5RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P5RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP5RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P5::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P5::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P5::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P6/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P6/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P6/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P6RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP6RequestMessageMaxMessages = 3; 33 | 34 | inline void P6RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P6RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP6RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P6::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P6::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P6::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P7RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P7/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P7/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P7/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P7RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP7RequestMessageMaxMessages = 3; 33 | 34 | inline void P7RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P7RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP7RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P7::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P7::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P7::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P8RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P8/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P8/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P8/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P8RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP8RequestMessageMaxMessages = 3; 33 | 34 | inline void P8RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P8RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP8RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P8::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P8::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P8::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P9/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P9/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P9/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P9RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP9RequestMessageMaxMessages = 3; 33 | 34 | inline void P9RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P9RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP9RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P9::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P9::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P9::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/dynamic_registrar.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | #include "fleetbench/dynamic_registrar.h" 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | namespace fleetbench { 22 | 23 | DynamicRegistrar* DynamicRegistrar::Get() { 24 | static DynamicRegistrar* dr = new DynamicRegistrar(); 25 | return dr; 26 | } 27 | 28 | void DynamicRegistrar::AddCallback(std::function callback) { 29 | callbacks_.push_back(std::move(callback)); 30 | } 31 | 32 | void DynamicRegistrar::Run() { 33 | for (auto& callback : callbacks_) { 34 | callback(); 35 | } 36 | callbacks_.clear(); 37 | } 38 | 39 | void DynamicRegistrar::AddDefaultFilter(std::string filter, 40 | ThreadingMode mode) { 41 | if (mode == ThreadingMode::kSingleThreaded || mode == ThreadingMode::kBoth) { 42 | if (!default_single_threaded_filter_.empty()) { 43 | default_single_threaded_filter_.push_back('|'); 44 | } 45 | default_single_threaded_filter_.append(filter); 46 | } 47 | if (mode == ThreadingMode::kMultiThreaded || mode == ThreadingMode::kBoth) { 48 | if (!default_multi_threaded_filter_.empty()) { 49 | default_multi_threaded_filter_.push_back('|'); 50 | } 51 | default_multi_threaded_filter_.append(filter); 52 | } 53 | } 54 | 55 | std::string DynamicRegistrar::GetDefaultFilter(ThreadingMode mode) const { 56 | if (mode == ThreadingMode::kSingleThreaded) { 57 | return default_single_threaded_filter_; 58 | } 59 | return default_multi_threaded_filter_; 60 | } 61 | 62 | } // namespace fleetbench 63 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P0ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P0/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P0/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P0/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P0ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP0ResponseMessageMaxMessages = 3; 33 | 34 | inline void P0ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P0ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP0ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P0::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P0::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P0::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P0RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10RequestMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10REQUESTMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10REQUESTMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P10/request/access_message0.h" 26 | #include "fleetbench/rpc/protos/P10/request/access_message1.h" 27 | #include "fleetbench/rpc/protos/P10/request/access_message2.h" 28 | #include "fleetbench/rpc/protos/P10RequestMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP10RequestMessageMaxMessages = 3; 33 | 34 | inline void P10RequestMessage_Set(const int msg_idx, const int var_idx, 35 | P10RequestMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP10RequestMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P10::request::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P10::request::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P10::request::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10REQUESTMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P1/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P1/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P1/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P1ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP1ResponseMessageMaxMessages = 3; 33 | 34 | inline void P1ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P1ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP1ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P1::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P1::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P1::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P2ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P2/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P2/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P2/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P2ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP2ResponseMessageMaxMessages = 3; 33 | 34 | inline void P2ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P2ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP2ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P2::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P2::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P2::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P2RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P3/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P3/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P3/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P3ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP3ResponseMessageMaxMessages = 3; 33 | 34 | inline void P3ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P3ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP3ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P3::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P3::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P3::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P4ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P4/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P4/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P4/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P4ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP4ResponseMessageMaxMessages = 3; 33 | 34 | inline void P4ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P4ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP4ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P4::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P4::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P4::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P4RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P5ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P5/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P5/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P5/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P5ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP5ResponseMessageMaxMessages = 3; 33 | 34 | inline void P5ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P5ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP5ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P5::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P5::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P5::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P5RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P6ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P6/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P6/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P6/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P6ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP6ResponseMessageMaxMessages = 3; 33 | 34 | inline void P6ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P6ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP6ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P6::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P6::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P6::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P6RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P7ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P7/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P7/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P7/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P7ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP7ResponseMessageMaxMessages = 3; 33 | 34 | inline void P7ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P7ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP7ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P7::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P7::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P7::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P7RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P8ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P8/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P8/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P8/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P8ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP8ResponseMessageMaxMessages = 3; 33 | 34 | inline void P8ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P8ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP8ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P8::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P8::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P8::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P8RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9ResponseMessage.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // Copyright 2024 The Fleetbench Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License" ); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // https://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an " AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | // WARNING: DO NOT EDIT! This file is auto-generated. 18 | 19 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9RESPONSEMESSAGE_H_ 20 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9RESPONSEMESSAGE_H_ 21 | 22 | #include 23 | 24 | #include "absl/log/check.h" 25 | #include "fleetbench/rpc/protos/P9/response/access_message0.h" 26 | #include "fleetbench/rpc/protos/P9/response/access_message1.h" 27 | #include "fleetbench/rpc/protos/P9/response/access_message2.h" 28 | #include "fleetbench/rpc/protos/P9ResponseMessage.pb.h" 29 | 30 | namespace fleetbench::rpc { 31 | 32 | const int kP9ResponseMessageMaxMessages = 3; 33 | 34 | inline void P9ResponseMessage_Set(const int msg_idx, const int var_idx, 35 | P9ResponseMessage* message, std::string* s) { 36 | CHECK_LT(msg_idx, kP9ResponseMessageMaxMessages) << "Invalid msg_idx"; 37 | 38 | switch (msg_idx) { 39 | case 0: 40 | fleetbench::rpc::P9::response::Message0::Message0_Set( 41 | var_idx, message->mutable_m_0(), s); 42 | break; 43 | 44 | case 1: 45 | fleetbench::rpc::P9::response::Message1::Message1_Set( 46 | var_idx, message->mutable_m_1(), s); 47 | break; 48 | 49 | case 2: 50 | fleetbench::rpc::P9::response::Message2::Message2_Set( 51 | var_idx, message->mutable_m_2(), s); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } // namespace fleetbench::rpc 60 | 61 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9RESPONSEMESSAGE_H_ 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P3/response/access_message0.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | 17 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3_RESPONSE_ACCESS_MESSAGE0_H_ 18 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3_RESPONSE_ACCESS_MESSAGE0_H_ 19 | 20 | #include 21 | 22 | #include "absl/log/check.h" 23 | #include "fleetbench/rpc/protos/P3/response/Message0.pb.h" 24 | 25 | namespace fleetbench::rpc::P3::response::Message0 { 26 | inline void Message0_Set_1(Message0* message, std::string* s) { 27 | (void)message; // Suppresses clang-tidy. 28 | } 29 | inline void Message0_Set_2(Message0* message, std::string* s) { 30 | message->set_f_0(0x60ffb8e); 31 | } 32 | inline void Message0_Set_3(Message0* message, std::string* s) { 33 | message->set_f_0(0x981f7ab); 34 | } 35 | inline void Message0_Set_4(Message0* message, std::string* s) { 36 | (void)message; // Suppresses clang-tidy. 37 | } 38 | const int kMessage0MaxProtoSetters = 4; 39 | inline void Message0_Set(const int i, Message0* message, std::string* s) { 40 | CHECK(i < kMessage0MaxProtoSetters) << "Invalid i"; 41 | switch (i) { 42 | case 0: 43 | Message0_Set_1(message, s); 44 | break; 45 | case 1: 46 | Message0_Set_2(message, s); 47 | break; 48 | case 2: 49 | Message0_Set_3(message, s); 50 | break; 51 | case 3: 52 | Message0_Set_4(message, s); 53 | break; 54 | default: 55 | break; 56 | } 57 | } 58 | } // namespace fleetbench::rpc::P3::response::Message0 59 | 60 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P3_RESPONSE_ACCESS_MESSAGE0_H_ 61 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P9/response/access_message2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | 17 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9_RESPONSE_ACCESS_MESSAGE2_H_ 18 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9_RESPONSE_ACCESS_MESSAGE2_H_ 19 | 20 | #include 21 | 22 | #include "absl/log/check.h" 23 | #include "fleetbench/rpc/protos/P9/response/Message2.pb.h" 24 | 25 | namespace fleetbench::rpc::P9::response::Message2 { 26 | inline void Message2_Set_1(Message2* message, std::string* s) { 27 | (void)message; // Suppresses clang-tidy. 28 | } 29 | inline void Message2_Set_2(Message2* message, std::string* s) { 30 | message->set_f_0(0xa7a8ba51); 31 | } 32 | inline void Message2_Set_3(Message2* message, std::string* s) { 33 | message->set_f_0(0x133dd8); 34 | } 35 | inline void Message2_Set_4(Message2* message, std::string* s) { 36 | (void)message; // Suppresses clang-tidy. 37 | } 38 | const int kMessage2MaxProtoSetters = 4; 39 | inline void Message2_Set(const int i, Message2* message, std::string* s) { 40 | CHECK(i < kMessage2MaxProtoSetters) << "Invalid i"; 41 | switch (i) { 42 | case 0: 43 | Message2_Set_1(message, s); 44 | break; 45 | case 1: 46 | Message2_Set_2(message, s); 47 | break; 48 | case 2: 49 | Message2_Set_3(message, s); 50 | break; 51 | case 3: 52 | Message2_Set_4(message, s); 53 | break; 54 | default: 55 | break; 56 | } 57 | } 58 | } // namespace fleetbench::rpc::P9::response::Message2 59 | 60 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P9_RESPONSE_ACCESS_MESSAGE2_H_ 61 | -------------------------------------------------------------------------------- /fleetbench/stl/cord_benchmark.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | #include 16 | #include 17 | 18 | #include "absl/strings/cord.h" 19 | #include "benchmark/benchmark.h" 20 | #include "fleetbench/common/common.h" 21 | #include "fleetbench/dynamic_registrar.h" 22 | #include "fleetbench/stl/generated_cord_benchmarks.h" 23 | 24 | namespace fleetbench::stl { 25 | 26 | static void BM_Cord(benchmark::State &state, 27 | void (*benchmark_code)(std::vector &), 28 | std::vector (*benchmark_setup)(), 29 | const std::string &label) { 30 | auto cords = benchmark_setup(); 31 | for (auto _ : state) { 32 | benchmark_code(cords); 33 | } 34 | if (!label.empty()) state.SetLabel(label); 35 | } 36 | 37 | void RegisterBenchmarks() { 38 | for (const auto &benchmark : GetBenchmarks()) { 39 | benchmark::internal::Benchmark *registered_benchmark = 40 | benchmark::RegisterBenchmark( 41 | benchmark.name, BM_Cord, benchmark.benchmark_code, 42 | benchmark.benchmark_setup, benchmark.label); 43 | if (UseExplicitIterationCounts() && benchmark.name == "BM_CORD_Fleet") { 44 | registered_benchmark->Iterations(100000); 45 | } 46 | } 47 | } 48 | 49 | class BenchmarkRegisterer { 50 | public: 51 | BenchmarkRegisterer() { 52 | DynamicRegistrar::Get()->AddCallback(RegisterBenchmarks); 53 | 54 | // We use the fleet-wide distribution as the defaults. 55 | DynamicRegistrar::Get()->AddDefaultFilter("BM_CORD_Fleet"); 56 | } 57 | }; 58 | 59 | BenchmarkRegisterer br; 60 | 61 | } // namespace fleetbench::stl 62 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P1/response/access_message2.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | 17 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1_RESPONSE_ACCESS_MESSAGE2_H_ 18 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1_RESPONSE_ACCESS_MESSAGE2_H_ 19 | 20 | #include 21 | 22 | #include "absl/log/check.h" 23 | #include "fleetbench/rpc/protos/P1/response/Message2.pb.h" 24 | 25 | namespace fleetbench::rpc::P1::response::Message2 { 26 | inline void Message2_Set_1(Message2* message, std::string* s) { 27 | (void)message; // Suppresses clang-tidy. 28 | } 29 | inline void Message2_Set_2(Message2* message, std::string* s) { 30 | (void)message; // Suppresses clang-tidy. 31 | } 32 | inline void Message2_Set_3(Message2* message, std::string* s) { 33 | message->set_f_0(0xd1f17); 34 | } 35 | inline void Message2_Set_4(Message2* message, std::string* s) { 36 | (void)message; // Suppresses clang-tidy. 37 | } 38 | const int kMessage2MaxProtoSetters = 4; 39 | inline void Message2_Set(const int i, Message2* message, std::string* s) { 40 | CHECK(i < kMessage2MaxProtoSetters) << "Invalid i"; 41 | switch (i) { 42 | case 0: 43 | Message2_Set_1(message, s); 44 | break; 45 | case 1: 46 | Message2_Set_2(message, s); 47 | break; 48 | case 2: 49 | Message2_Set_3(message, s); 50 | break; 51 | case 3: 52 | Message2_Set_4(message, s); 53 | break; 54 | default: 55 | break; 56 | } 57 | } 58 | } // namespace fleetbench::rpc::P1::response::Message2 59 | 60 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P1_RESPONSE_ACCESS_MESSAGE2_H_ 61 | -------------------------------------------------------------------------------- /fleetbench/rpc/protos/P10/request/access_message1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Fleetbench 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 | // https://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 | // WARNING: DO NOT EDIT! This file is auto-generated. 16 | 17 | #ifndef THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10_REQUEST_ACCESS_MESSAGE1_H_ 18 | #define THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10_REQUEST_ACCESS_MESSAGE1_H_ 19 | 20 | #include 21 | 22 | #include "absl/log/check.h" 23 | #include "fleetbench/rpc/protos/P10/request/Message1.pb.h" 24 | 25 | namespace fleetbench::rpc::P10::request::Message1 { 26 | inline void Message1_Set_1(Message1* message, std::string* s) { 27 | message->set_f_0(0x1b1e188a0431b); 28 | } 29 | inline void Message1_Set_2(Message1* message, std::string* s) { 30 | (void)message; // Suppresses clang-tidy. 31 | } 32 | inline void Message1_Set_3(Message1* message, std::string* s) { 33 | (void)message; // Suppresses clang-tidy. 34 | } 35 | inline void Message1_Set_4(Message1* message, std::string* s) { 36 | message->set_f_0(0x2b5a9ef4342); 37 | } 38 | const int kMessage1MaxProtoSetters = 4; 39 | inline void Message1_Set(const int i, Message1* message, std::string* s) { 40 | CHECK(i < kMessage1MaxProtoSetters) << "Invalid i"; 41 | switch (i) { 42 | case 0: 43 | Message1_Set_1(message, s); 44 | break; 45 | case 1: 46 | Message1_Set_2(message, s); 47 | break; 48 | case 2: 49 | Message1_Set_3(message, s); 50 | break; 51 | case 3: 52 | Message1_Set_4(message, s); 53 | break; 54 | default: 55 | break; 56 | } 57 | } 58 | } // namespace fleetbench::rpc::P10::request::Message1 59 | 60 | #endif // THIRD_PARTY_FLEETBENCH_RPC_PROTOS_P10_REQUEST_ACCESS_MESSAGE1_H_ 61 | --------------------------------------------------------------------------------