From 20d89d6802b67e2b8c864bedf23673d008e3faab Mon Sep 17 00:00:00 2001 From: jonatack Date: Mon, 23 Jan 2023 07:49:46 -0800 Subject: [PATCH] bench: document expected results in logging benchmarks and clarify the intention behind the -nodebuglogfile bench. Co-authored-by: "kouloumos " Co-authored-by: "Larry Ruane " --- src/bench/logging.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bench/logging.cpp b/src/bench/logging.cpp index f6e5bc54e87..9aedb26236d 100644 --- a/src/bench/logging.cpp +++ b/src/bench/logging.cpp @@ -6,6 +6,11 @@ #include #include +// All but 2 of the benchmarks should have roughly similar performance: +// +// LogPrintWithoutCategory should be ~3 orders of magnitude faster, as nothing is logged. +// +// LogWithoutWriteToFile should be ~2 orders of magnitude faster, as it avoids disk writes. static void Logging(benchmark::Bench& bench, const std::vector& extra_args, const std::function& log) { @@ -68,6 +73,7 @@ static void LogPrintfWithoutThreadNames(benchmark::Bench& bench) static void LogWithoutWriteToFile(benchmark::Bench& bench) { + // Disable writing the log to a file, as used for unit tests and fuzzing in `MakeNoLogFileContext`. Logging(bench, {"-nodebuglogfile", "-debug=1"}, [] { LogPrintf("%s\n", "test"); LogPrint(BCLog::NET, "%s\n", "test");