Skip to content

Commit 7196af6

Browse files
[workspace] Upgrade googlebenchmark to latest release v1.9.2 (#22854)
Co-authored-by: Rick Poyner <[email protected]>
1 parent 6352516 commit 7196af6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tools/workspace/googlebenchmark/patches/console_allocs.patch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ reworking the patch and tests to be suitable.
55

66
--- src/console_reporter.cc
77
+++ src/console_reporter.cc
8-
@@ -53,9 +53,11 @@ bool ConsoleReporter::ReportContext(const Context& context) {
9-
}
8+
@@ -59,9 +59,11 @@ bool ConsoleReporter::ReportContext(const Context& context) {
109

10+
BENCHMARK_EXPORT
1111
void ConsoleReporter::PrintHeader(const Run& run) {
12-
+ const bool show_allocs = (run.memory_result != nullptr);
12+
+ const bool show_allocs = (run.memory_result.memory_iterations > 0);
1313
std::string str =
1414
- FormatString("%-*s %13s %15s %12s", static_cast<int>(name_field_width_),
1515
- "Benchmark", "Time", "CPU", "Iterations");
1616
+ FormatString("%-*s %13s %15s %*s%12s", static_cast<int>(name_field_width_),
1717
+ "Benchmark", "Time", "CPU", show_allocs ? 10 : 0,
1818
+ show_allocs ? "Allocs " : "", "Iterations");
1919
if (!run.counters.empty()) {
20-
if (output_options_ & OO_Tabular) {
20+
if ((output_options_ & OO_Tabular) != 0) {
2121
for (auto const& c : run.counters) {
22-
@@ -163,6 +165,11 @@ void ConsoleReporter::PrintRunData(const Run& result) {
22+
@@ -176,6 +178,11 @@ void ConsoleReporter::PrintRunData(const Run& result) {
2323
}
2424

2525
if (!result.report_big_o && !result.report_rms) {
26-
+ const bool show_allocs = (result.memory_result != nullptr);
26+
+ const bool show_allocs = (result.memory_result.memory_iterations > 0);
2727
+ if (show_allocs) {
2828
+ const std::string s = HumanReadableNumber(result.allocs_per_iter, Counter::kIs1000);
2929
+ printer(Out, COLOR_YELLOW, "%7s ", s.c_str());

tools/workspace/googlebenchmark/repository.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def googlebenchmark_repository(
66
github_archive(
77
name = name,
88
repository = "google/benchmark",
9-
commit = "v1.9.1",
10-
sha256 = "32131c08ee31eeff2c8968d7e874f3cb648034377dfc32a4c377fa8796d84981", # noqa
9+
commit = "v1.9.2",
10+
sha256 = "409075176168dc46bbb81b74c1b4b6900385b5d16bfc181d678afb060d928bd3", # noqa
1111
mirrors = mirrors,
1212
patches = [
1313
":patches/console_allocs.patch",

0 commit comments

Comments
 (0)