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");