Skip to content

Commit 102b203

Browse files
committed
bench: order the logging benchmark code by output
1 parent 4b3fdbf commit 102b203

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/bench/logging.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,26 @@ static void Logging(benchmark::Bench& bench, const std::vector<const char*>& ext
2020
bench.run([&] { log(); });
2121
}
2222

23-
static void LogPrintfWithThreadNames(benchmark::Bench& bench)
24-
{
25-
Logging(bench, {"-logthreadnames=1"}, [] { LogPrintf("%s\n", "test"); });
26-
}
27-
static void LogPrintfWithoutThreadNames(benchmark::Bench& bench)
28-
{
29-
Logging(bench, {"-logthreadnames=0"}, [] { LogPrintf("%s\n", "test"); });
30-
}
3123
static void LogPrintWithCategory(benchmark::Bench& bench)
3224
{
3325
Logging(bench, {"-logthreadnames=0", "-debug=net"}, [] { LogPrint(BCLog::NET, "%s\n", "test"); });
3426
}
27+
3528
static void LogPrintWithoutCategory(benchmark::Bench& bench)
3629
{
3730
Logging(bench, {"-logthreadnames=0", "-debug=0"}, [] { LogPrint(BCLog::NET, "%s\n", "test"); });
3831
}
32+
33+
static void LogPrintfWithThreadNames(benchmark::Bench& bench)
34+
{
35+
Logging(bench, {"-logthreadnames=1"}, [] { LogPrintf("%s\n", "test"); });
36+
}
37+
38+
static void LogPrintfWithoutThreadNames(benchmark::Bench& bench)
39+
{
40+
Logging(bench, {"-logthreadnames=0"}, [] { LogPrintf("%s\n", "test"); });
41+
}
42+
3943
static void LogWithoutWriteToFile(benchmark::Bench& bench)
4044
{
4145
Logging(bench, {"-nodebuglogfile", "-debug=1"}, [] {
@@ -44,8 +48,8 @@ static void LogWithoutWriteToFile(benchmark::Bench& bench)
4448
});
4549
}
4650

47-
BENCHMARK(LogPrintfWithThreadNames, benchmark::PriorityLevel::HIGH);
48-
BENCHMARK(LogPrintfWithoutThreadNames, benchmark::PriorityLevel::HIGH);
4951
BENCHMARK(LogPrintWithCategory, benchmark::PriorityLevel::HIGH);
5052
BENCHMARK(LogPrintWithoutCategory, benchmark::PriorityLevel::HIGH);
53+
BENCHMARK(LogPrintfWithThreadNames, benchmark::PriorityLevel::HIGH);
54+
BENCHMARK(LogPrintfWithoutThreadNames, benchmark::PriorityLevel::HIGH);
5155
BENCHMARK(LogWithoutWriteToFile, benchmark::PriorityLevel::HIGH);

0 commit comments

Comments
 (0)