@@ -45,17 +45,34 @@ struct TestBlockAndIndex {
45
45
46
46
} // namespace
47
47
48
- static void BlockToJsonVerbose (benchmark::Bench& bench)
48
+ static void BlockToJson (benchmark::Bench& bench, TxVerbosity verbosity )
49
49
{
50
50
TestBlockAndIndex data;
51
51
const uint256 pow_limit{data.testing_setup ->m_node .chainman ->GetParams ().GetConsensus ().powLimit };
52
52
bench.run ([&] {
53
- auto univalue = blockToJSON (data.testing_setup ->m_node .chainman ->m_blockman , data.block , data.blockindex , data.blockindex , TxVerbosity::SHOW_DETAILS_AND_PREVOUT , pow_limit);
53
+ auto univalue = blockToJSON (data.testing_setup ->m_node .chainman ->m_blockman , data.block , data.blockindex , data.blockindex , verbosity , pow_limit);
54
54
ankerl::nanobench::doNotOptimizeAway (univalue);
55
55
});
56
56
}
57
57
58
- BENCHMARK (BlockToJsonVerbose, benchmark::PriorityLevel::HIGH);
58
+ static void BlockToJsonVerbosity1 (benchmark::Bench& bench)
59
+ {
60
+ BlockToJson (bench, TxVerbosity::SHOW_TXID);
61
+ }
62
+
63
+ static void BlockToJsonVerbosity2 (benchmark::Bench& bench)
64
+ {
65
+ BlockToJson (bench, TxVerbosity::SHOW_DETAILS);
66
+ }
67
+
68
+ static void BlockToJsonVerbosity3 (benchmark::Bench& bench)
69
+ {
70
+ BlockToJson (bench, TxVerbosity::SHOW_DETAILS_AND_PREVOUT);
71
+ }
72
+
73
+ BENCHMARK (BlockToJsonVerbosity1, benchmark::PriorityLevel::HIGH);
74
+ BENCHMARK (BlockToJsonVerbosity2, benchmark::PriorityLevel::HIGH);
75
+ BENCHMARK (BlockToJsonVerbosity3, benchmark::PriorityLevel::HIGH);
59
76
60
77
static void BlockToJsonVerboseWrite (benchmark::Bench& bench)
61
78
{
0 commit comments