-
Notifications
You must be signed in to change notification settings - Fork 5.4k
eds: decrease computational complexity of updates #11442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b6393c6
779aa74
5005fcf
de4eeb7
46a176e
b81bf9b
f846f8f
dabdeb6
6d08d00
7cccabb
4d1acad
d8929c3
b21f4e1
5fb29eb
3661e8f
6dd6560
5f4a5a7
db737b9
3c37bc6
e99517d
60e769f
3644413
558423a
2b689d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Set the benchmark time to 0 to just verify that the benchmark runs to completion. | ||
| "${TEST_SRCDIR}/envoy/$@" --benchmark_min_time=0 | ||
| # Set the benchmark time to 0 to just verify that the benchmark runs to | ||
| # completion. We're interacting with two different flag parsers, so the order | ||
| # of flags and the -- matters. | ||
| "${TEST_SRCDIR}/envoy/$@" --skip_expensive_benchmarks -- --benchmark_min_time=0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,40 @@ | ||
| // NOLINT(namespace-envoy) | ||
| // This is an Envoy driver for benchmarks. | ||
| #include "test/benchmark/main.h" | ||
|
|
||
| #include "test/test_common/environment.h" | ||
|
|
||
| #include "benchmark/benchmark.h" | ||
| #include "tclap/CmdLine.h" | ||
|
|
||
| static bool skip_expensive_benchmarks = false; | ||
|
|
||
| // Boilerplate main(), which discovers benchmarks and runs them. | ||
| // Boilerplate main(), which discovers benchmarks and runs them. This uses two | ||
| // different flag parsers, so the order of flags matters: flags defined here | ||
| // must be passed first, and flags defined in benchmark::Initialize second, | ||
| // separated by --. | ||
| // TODO(pgenera): convert this to abseil/flags/ when benchmark also adopts abseil. | ||
| int main(int argc, char** argv) { | ||
| Envoy::TestEnvironment::initializeTestMain(argv[0]); | ||
|
|
||
| benchmark::Initialize(&argc, argv); | ||
| if (benchmark::ReportUnrecognizedArguments(argc, argv)) { | ||
| return 1; | ||
| // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.VirtualCall) | ||
| TCLAP::CmdLine cmd("envoy-benchmark-test", ' ', "0.1"); | ||
| TCLAP::SwitchArg skip_switch("s", "skip_expensive_benchmarks", | ||
| "skip or minimize expensive benchmarks", cmd, false); | ||
|
|
||
| cmd.setExceptionHandling(false); | ||
| try { | ||
| cmd.parse(argc, argv); | ||
| } catch (const TCLAP::ExitException& e) { | ||
| // parse() throws an ExitException with status 0 after printing the output | ||
| // for --help and --version. | ||
| return 0; | ||
| } | ||
|
|
||
| skip_expensive_benchmarks = skip_switch.getValue(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we add some big nice WARNING when this flag is enabled in order to increase the chances of someone noticing the difference between envoy_cc_benchmarks and tests for those benchmarks?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in #12121 |
||
|
|
||
| benchmark::Initialize(&argc, argv); | ||
| benchmark::RunSpecifiedBenchmarks(); | ||
| } | ||
|
|
||
| bool Envoy::benchmark::skipExpensiveBenchmarks() { return skip_expensive_benchmarks; } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #pragma once | ||
|
|
||
| /** | ||
| * Benchmarks can use this to skip or hurry through long-running tests in CI. | ||
| */ | ||
|
|
||
| namespace Envoy { | ||
| namespace benchmark { | ||
|
|
||
| bool skipExpensiveBenchmarks(); | ||
|
pgenera marked this conversation as resolved.
|
||
|
|
||
| } | ||
| } // namespace Envoy | ||
Uh oh!
There was an error while loading. Please reload this page.