mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
-BEGIN VERIFY SCRIPT- sed --in-place --regexp-extended 's/BENCHMARK\(([^,]+), benchmark::PriorityLevel::(HIGH|LOW)\)/BENCHMARK(\1)/g' $( git grep -l PriorityLevel ) sed --in-place 's/#define BENCHMARK(n, priority_level)/#define BENCHMARK(n)/g' ./src/bench/bench.h -END VERIFY SCRIPT-
22 lines
607 B
C++
22 lines
607 B
C++
// Copyright (c) 2022-present The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#include <bench/bench.h>
|
|
#include <bench/data/block413567.raw.h>
|
|
#include <span.h>
|
|
#include <util/strencodings.h>
|
|
|
|
#include <vector>
|
|
|
|
static void HexStrBench(benchmark::Bench& bench)
|
|
{
|
|
auto const& data = benchmark::data::block413567;
|
|
bench.batch(data.size()).unit("byte").run([&] {
|
|
auto hex = HexStr(data);
|
|
ankerl::nanobench::doNotOptimizeAway(hex);
|
|
});
|
|
}
|
|
|
|
BENCHMARK(HexStrBench);
|