From 102b2033493f0d61e9763d094cb8a0017f7e3a10 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Mon, 11 Jul 2022 11:23:45 +0200 Subject: [PATCH] bench: order the logging benchmark code by output --- src/bench/logging.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/bench/logging.cpp b/src/bench/logging.cpp index 59b89b1a797..a7162d09acb 100644 --- a/src/bench/logging.cpp +++ b/src/bench/logging.cpp @@ -20,22 +20,26 @@ static void Logging(benchmark::Bench& bench, const std::vector& ext bench.run([&] { log(); }); } -static void LogPrintfWithThreadNames(benchmark::Bench& bench) -{ - Logging(bench, {"-logthreadnames=1"}, [] { LogPrintf("%s\n", "test"); }); -} -static void LogPrintfWithoutThreadNames(benchmark::Bench& bench) -{ - Logging(bench, {"-logthreadnames=0"}, [] { LogPrintf("%s\n", "test"); }); -} static void LogPrintWithCategory(benchmark::Bench& bench) { Logging(bench, {"-logthreadnames=0", "-debug=net"}, [] { LogPrint(BCLog::NET, "%s\n", "test"); }); } + static void LogPrintWithoutCategory(benchmark::Bench& bench) { Logging(bench, {"-logthreadnames=0", "-debug=0"}, [] { LogPrint(BCLog::NET, "%s\n", "test"); }); } + +static void LogPrintfWithThreadNames(benchmark::Bench& bench) +{ + Logging(bench, {"-logthreadnames=1"}, [] { LogPrintf("%s\n", "test"); }); +} + +static void LogPrintfWithoutThreadNames(benchmark::Bench& bench) +{ + Logging(bench, {"-logthreadnames=0"}, [] { LogPrintf("%s\n", "test"); }); +} + static void LogWithoutWriteToFile(benchmark::Bench& bench) { Logging(bench, {"-nodebuglogfile", "-debug=1"}, [] { @@ -44,8 +48,8 @@ static void LogWithoutWriteToFile(benchmark::Bench& bench) }); } -BENCHMARK(LogPrintfWithThreadNames, benchmark::PriorityLevel::HIGH); -BENCHMARK(LogPrintfWithoutThreadNames, benchmark::PriorityLevel::HIGH); BENCHMARK(LogPrintWithCategory, benchmark::PriorityLevel::HIGH); BENCHMARK(LogPrintWithoutCategory, benchmark::PriorityLevel::HIGH); +BENCHMARK(LogPrintfWithThreadNames, benchmark::PriorityLevel::HIGH); +BENCHMARK(LogPrintfWithoutThreadNames, benchmark::PriorityLevel::HIGH); BENCHMARK(LogWithoutWriteToFile, benchmark::PriorityLevel::HIGH);