Skip to content

Commit 20d89d6

Browse files
committed
bench: document expected results in logging benchmarks
and clarify the intention behind the -nodebuglogfile bench. Co-authored-by: "kouloumos <[email protected]>" Co-authored-by: "Larry Ruane <[email protected]>"
1 parent d8deba8 commit 20d89d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bench/logging.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#include <logging.h>
77
#include <test/util/setup_common.h>
88

9+
// All but 2 of the benchmarks should have roughly similar performance:
10+
//
11+
// LogPrintWithoutCategory should be ~3 orders of magnitude faster, as nothing is logged.
12+
//
13+
// LogWithoutWriteToFile should be ~2 orders of magnitude faster, as it avoids disk writes.
914

1015
static void Logging(benchmark::Bench& bench, const std::vector<const char*>& extra_args, const std::function<void()>& log)
1116
{
@@ -68,6 +73,7 @@ static void LogPrintfWithoutThreadNames(benchmark::Bench& bench)
6873

6974
static void LogWithoutWriteToFile(benchmark::Bench& bench)
7075
{
76+
// Disable writing the log to a file, as used for unit tests and fuzzing in `MakeNoLogFileContext`.
7177
Logging(bench, {"-nodebuglogfile", "-debug=1"}, [] {
7278
LogPrintf("%s\n", "test");
7379
LogPrint(BCLog::NET, "%s\n", "test");

0 commit comments

Comments
 (0)