Bitcoin Core 28.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
strencodings.cpp
Go to the documentation of this file.
1// Copyright (c) 2022 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <bench/bench.h>
6#include <bench/data.h>
7#include <util/strencodings.h>
8
9static void HexStrBench(benchmark::Bench& bench)
10{
11 auto const& data = benchmark::data::block413567;
12 bench.batch(data.size()).unit("byte").run([&] {
13 auto hex = HexStr(data);
15 });
16}
17
#define BENCHMARK(n, priority_level)
Definition bench.h:79
static void HexStrBench(benchmark::Bench &bench)
Main entry point to nanobench's benchmarking facility.
Definition nanobench.h:627
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Definition nanobench.h:1234
Bench & batch(T b) noexcept
Sets the batch size.
Definition nanobench.h:1258
Bench & unit(char const *unit)
Sets the operation unit.
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
Definition hex_base.cpp:29
void doNotOptimizeAway(Arg &&arg)
Makes sure none of the given arguments are optimized away by the compiler.
Definition nanobench.h:1279
const std::vector< uint8_t > block413567
Definition data.cpp:11
@ HIGH
Definition bench.h:47