@@ -20,6 +20,18 @@ static void Logging(benchmark::Bench& bench, const std::vector<const char*>& ext
20
20
bench.run ([&] { log (); });
21
21
}
22
22
23
+ static void LogPrintLevelWithThreadNames (benchmark::Bench& bench)
24
+ {
25
+ Logging (bench, {" -logthreadnames=1" , " -debug=net" }, [] {
26
+ LogPrintLevel (BCLog::NET, BCLog::Level::Error, " %s\n " , " test" ); });
27
+ }
28
+
29
+ static void LogPrintLevelWithoutThreadNames (benchmark::Bench& bench)
30
+ {
31
+ Logging (bench, {" -logthreadnames=0" , " -debug=net" }, [] {
32
+ LogPrintLevel (BCLog::NET, BCLog::Level::Error, " %s\n " , " test" ); });
33
+ }
34
+
23
35
static void LogPrintWithCategory (benchmark::Bench& bench)
24
36
{
25
37
Logging (bench, {" -logthreadnames=0" , " -debug=net" }, [] { LogPrint (BCLog::NET, " %s\n " , " test" ); });
@@ -30,6 +42,20 @@ static void LogPrintWithoutCategory(benchmark::Bench& bench)
30
42
Logging (bench, {" -logthreadnames=0" , " -debug=0" }, [] { LogPrint (BCLog::NET, " %s\n " , " test" ); });
31
43
}
32
44
45
+ static void LogPrintfCategoryWithThreadNames (benchmark::Bench& bench)
46
+ {
47
+ Logging (bench, {" -logthreadnames=1" , " -debug=net" }, [] {
48
+ LogPrintfCategory (BCLog::NET, " %s\n " , " test" );
49
+ });
50
+ }
51
+
52
+ static void LogPrintfCategoryWithoutThreadNames (benchmark::Bench& bench)
53
+ {
54
+ Logging (bench, {" -logthreadnames=0" , " -debug=net" }, [] {
55
+ LogPrintfCategory (BCLog::NET, " %s\n " , " test" );
56
+ });
57
+ }
58
+
33
59
static void LogPrintfWithThreadNames (benchmark::Bench& bench)
34
60
{
35
61
Logging (bench, {" -logthreadnames=1" }, [] { LogPrintf (" %s\n " , " test" ); });
@@ -48,8 +74,12 @@ static void LogWithoutWriteToFile(benchmark::Bench& bench)
48
74
});
49
75
}
50
76
77
+ BENCHMARK (LogPrintLevelWithThreadNames, benchmark::PriorityLevel::HIGH);
78
+ BENCHMARK (LogPrintLevelWithoutThreadNames, benchmark::PriorityLevel::HIGH);
51
79
BENCHMARK (LogPrintWithCategory, benchmark::PriorityLevel::HIGH);
52
80
BENCHMARK (LogPrintWithoutCategory, benchmark::PriorityLevel::HIGH);
81
+ BENCHMARK (LogPrintfCategoryWithThreadNames, benchmark::PriorityLevel::HIGH);
82
+ BENCHMARK (LogPrintfCategoryWithoutThreadNames, benchmark::PriorityLevel::HIGH);
53
83
BENCHMARK (LogPrintfWithThreadNames, benchmark::PriorityLevel::HIGH);
54
84
BENCHMARK (LogPrintfWithoutThreadNames, benchmark::PriorityLevel::HIGH);
55
85
BENCHMARK (LogWithoutWriteToFile, benchmark::PriorityLevel::HIGH);
0 commit comments