mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
bench: document expected results in logging benchmarks
and clarify the intention behind the -nodebuglogfile bench. Co-authored-by: "kouloumos <kouloumosa@gmail.com>" Co-authored-by: "Larry Ruane <larryruane@gmail.com>"
This commit is contained in:
parent
d8deba8c36
commit
20d89d6802
@ -6,6 +6,11 @@
|
|||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <test/util/setup_common.h>
|
#include <test/util/setup_common.h>
|
||||||
|
|
||||||
|
// 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<const char*>& extra_args, const std::function<void()>& log)
|
static void Logging(benchmark::Bench& bench, const std::vector<const char*>& extra_args, const std::function<void()>& log)
|
||||||
{
|
{
|
||||||
@ -68,6 +73,7 @@ static void LogPrintfWithoutThreadNames(benchmark::Bench& bench)
|
|||||||
|
|
||||||
static void LogWithoutWriteToFile(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"}, [] {
|
Logging(bench, {"-nodebuglogfile", "-debug=1"}, [] {
|
||||||
LogPrintf("%s\n", "test");
|
LogPrintf("%s\n", "test");
|
||||||
LogPrint(BCLog::NET, "%s\n", "test");
|
LogPrint(BCLog::NET, "%s\n", "test");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user