Upgrade benchmark to 1.6.0 and remove previous hacks. (#27778)

* Upgrade benchmark to 1.6.0 and remove hacks.

Details:
 - GRPC currently uses an old version of benchmark (from Sept 2020). It should probably upgrade because downstream, in google3, everyone is already using 1.6.0)
 - Removed the hack added in PR/27629 to allow benchmarks in GRPC to continue to work with both pre-1.6.0 and 1.6.0 benchmarks.
   (This was needed to allow importing benchmarks 1.6.0 into google3 without breaking GRPC)

* fix typo

* update third_party/benchmark and check_submodules.sh

* Upmerge from v1.41.x (#27821)

* Bump version to v1.41.0-pre1 (#27371)

* Bump version to v1.41.0-pre1

* Regenerate projects

* [Backport #27373] add testing_version flag (#27385)

* Bump version to v1.41.0-pre2 (#27390)

* Bump version to v1.41.0-pre2

* Regenerate projects

* Core 19: bump core version from 18.0.0 to 19.0.0 (#27394)

* Bump core version to 19.0.0

* Regenerate projects

* fix use-after-free metadata corruption in C# when receiving response headers for streaming response calls (#27398)

* Final release: bump up version to 1.41.0 (#27476)

* Bump version to 1.41.0

* Regenerate projects

* xds_k8s_test: increase timeout to 3 hours due to recent timeout failure (#27580)

* Revert "xds_k8s_test: increase timeout to 3 hours due to recent timeout failure (#27580)" (#27590)

This reverts commit da0c7d680f.

* Update root pem certs (backport of #27539) (#27619)

* Update boringssl to the latest (#27606) (#27625)

* Change boringssl branch name

* update submodule boringssl-with-bazel with origin/main-with-bazel

* update boringssl dependency to main-with-bazel commit SHA

* regenerate files

* Increment podspec version

* generate boringssl prefix headers

* Bumping up version to v1.41.1 (#27699)

* Bump version to v1.41.1

* Regenerate projects

* [Backport][v1.41.x] xds-k8s tests: Use test driver from master branch (#27695)

Backports sourcing the test driver install script from master.

This is a backport of #27389, #27462 and #27658:


* Add missing quatation marks.

These were missed when  creating the Python virtual env.

* xds-k8s tests: Use test driver from master branch (#27462)

Instead of directly sourcing the test driver provisioning script from the same branch, the script is downloaded (with curl) and sourced from the master branch.

This allows changes made to the test driver to be reflected in all future release branches. A separate PR will backport this change to existing release branches.

All cluster definitions are also moved to the install script, allowing any cluster changes to be done in one place in the master branch.

* xds_k8s tests: Fix xlang install script sourcing. (#27658)

This change sources the test driver install script correctly for the xlang tests.
This fixes a mistake in #27462 where this was missed.

* Fix Python Interop (#27620) (#27703)

* WIP. Attempt to fix interop

* Yapf

* Switch Python xDS Example Server to Listen on IPV4 Only (#27679)

* Switch to IPV4

* Update to all hosts

* Fix rvm ruby install failure (#27769)

Co-authored-by: donnadionne <donnadionne@google.com>
Co-authored-by: Lidi Zheng <lidiz@google.com>
Co-authored-by: Jan Tattermusch <jtattermusch@users.noreply.github.com>
Co-authored-by: sanjaypujare <sanjaypujare@users.noreply.github.com>
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
Co-authored-by: Esun Kim <veblush@google.com>
Co-authored-by: Terry Wilson <terrymwilson@gmail.com>
Co-authored-by: Richard Belleville <rbellevi@google.com>

* added perf_counters.cc manually since the script didn't work

Co-authored-by: Mark D. Roth <roth@google.com>
Co-authored-by: donnadionne <donnadionne@google.com>
Co-authored-by: Lidi Zheng <lidiz@google.com>
Co-authored-by: Jan Tattermusch <jtattermusch@users.noreply.github.com>
Co-authored-by: sanjaypujare <sanjaypujare@users.noreply.github.com>
Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
Co-authored-by: Esun Kim <veblush@google.com>
Co-authored-by: Terry Wilson <terrymwilson@gmail.com>
Co-authored-by: Richard Belleville <rbellevi@google.com>
pull/27840/head
Vy Nguyen 3 years ago committed by GitHub
parent 06b5061d35
commit 70b26a1c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      bazel/grpc_deps.bzl
  2. 1
      grpc.gyp
  3. 2
      test/cpp/microbenchmarks/bm_cq_multiple_threads.cc
  4. 4
      test/cpp/microbenchmarks/bm_threadpool.cc
  5. 31
      test/cpp/util/test_config.h
  6. 2
      third_party/benchmark
  7. 2
      tools/run_tests/sanity/check_submodules.sh

@ -249,11 +249,11 @@ def grpc_deps():
if "com_github_google_benchmark" not in native.existing_rules():
http_archive(
name = "com_github_google_benchmark",
sha256 = "daa4a97e0547d76de300e325a49177b199f3689ce5a35e25d47696f7cb050f86",
strip_prefix = "benchmark-73d4d5e8d6d449fc8663765a42aa8aeeee844489",
sha256 = "0b921a3bc39e35f4275c8dcc658af2391c150fb966102341287b0401ff2e6f21",
strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz",
"https://github.com/google/benchmark/archive/73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz",
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz",
"https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.tar.gz",
],
)

1
grpc.gyp generated

@ -1966,6 +1966,7 @@
'third_party/benchmark/src/counter.cc',
'third_party/benchmark/src/csv_reporter.cc',
'third_party/benchmark/src/json_reporter.cc',
'third_party/benchmark/src/perf_counters.cc',
'third_party/benchmark/src/reporter.cc',
'third_party/benchmark/src/sleep.cc',
'third_party/benchmark/src/statistics.cc',

@ -162,7 +162,7 @@ static void teardown() {
*/
static void BM_Cq_Throughput(benchmark::State& state) {
gpr_timespec deadline = gpr_inf_future(GPR_CLOCK_MONOTONIC);
auto thd_idx = hack::get_thread_idx(state);
auto thd_idx = state.thread_index();
gpr_mu_lock(&g_mu);
g_threads_active++;

@ -152,13 +152,13 @@ class SuicideFunctorForAdd : public grpc_completion_queue_functor {
// Performs the scenario of external thread(s) adding closures into pool.
static void BM_ThreadPoolExternalAdd(benchmark::State& state) {
static grpc_core::ThreadPool* external_add_pool = nullptr;
int thread_idx = hack::get_thread_idx(state);
int thread_idx = state.thread_index();
// Setup for each run of test.
if (thread_idx == 0) {
const int num_threads = state.range(1);
external_add_pool = new grpc_core::ThreadPool(num_threads);
}
const int num_iterations = state.range(0) / hack::get_threads(state);
const int num_iterations = state.range(0) / state.threads();
while (state.KeepRunningBatch(num_iterations)) {
BlockingCounter counter(num_iterations);
for (int i = 0; i < num_iterations; ++i) {

@ -19,8 +19,6 @@
#ifndef GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
#define GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
#include <type_traits>
#ifndef GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
#define GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE(style) \
::testing::FLAGS_gtest_death_test_style = style
@ -31,35 +29,6 @@ namespace testing {
void InitTest(int* argc, char*** argv, bool remove_flags);
// FIXME(vyng): remove this
// This is hack to accommdate accessing .threads and .thread_index on benchmark
// State object. (In 1.6.0, the fields were made into methods, hence it's API
// breaking).
namespace hack {
template <typename T>
auto get_threads(T& t) -> decltype(t.threads()) {
return t.threads();
}
template <typename T>
auto get_threads(T& t) -> decltype(t.threads) {
return t.threads;
}
template <typename T>
auto get_thread_idx(T& t) -> decltype(t.thread_index()) {
return t.thread_index();
}
template <typename T>
auto get_thread_idx(T& t) -> decltype(t.thread_index) {
return t.thread_index;
}
} // namespace hack
} // namespace testing
} // namespace grpc

@ -1 +1 @@
Subproject commit 73d4d5e8d6d449fc8663765a42aa8aeeee844489
Subproject commit 0baacde3618ca617da95375e0af13ce1baadea47

@ -26,7 +26,7 @@ want_submodules=$(mktemp /tmp/submXXXXXX)
git submodule | awk '{ print $2 " " $1 }' | sort >"$submodules"
cat <<EOF | sort >"$want_submodules"
third_party/abseil-cpp 278e0a071885a22dcd2fd1b5576cc44757299343
third_party/benchmark 73d4d5e8d6d449fc8663765a42aa8aeeee844489
third_party/benchmark 0baacde3618ca617da95375e0af13ce1baadea47
third_party/bloaty 73594cde8c9a52a102c4341c244c833aa61b9c06
third_party/boringssl-with-bazel 95b3ed1b01f2ef1d72fed290ed79fe1b0e7dafc0
third_party/cares/cares e982924acee7f7313b4baa4ee5ec000c5e373c30

Loading…
Cancel
Save