|
|
@ -1,8 +1,16 @@ |
|
|
|
// Copyright (c) 2015 The Bitcoin Core developers
|
|
|
|
// Copyright (c) 2015 The Bitcoin Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_BENCH_H |
|
|
|
|
|
|
|
#define BITCOIN_BENCH_H |
|
|
|
#ifndef BITCOIN_BENCH_BENCH_H |
|
|
|
|
|
|
|
#define BITCOIN_BENCH_BENCH_H |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <map> |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/function.hpp> |
|
|
|
|
|
|
|
#include <boost/preprocessor/cat.hpp> |
|
|
|
|
|
|
|
#include <boost/preprocessor/stringize.hpp> |
|
|
|
|
|
|
|
|
|
|
|
// Simple micro-benchmarking framework; API mostly matches a subset of the Google Benchmark
|
|
|
|
// Simple micro-benchmarking framework; API mostly matches a subset of the Google Benchmark
|
|
|
|
// framework (see https://github.com/google/benchmark)
|
|
|
|
// framework (see https://github.com/google/benchmark)
|
|
|
@ -25,14 +33,7 @@ static void CODE_TO_TIME(benchmark::State& state) |
|
|
|
BENCHMARK(CODE_TO_TIME); |
|
|
|
BENCHMARK(CODE_TO_TIME); |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <boost/function.hpp> |
|
|
|
|
|
|
|
#include <boost/preprocessor/cat.hpp> |
|
|
|
|
|
|
|
#include <boost/preprocessor/stringize.hpp> |
|
|
|
|
|
|
|
#include <map> |
|
|
|
|
|
|
|
#include <string> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace benchmark { |
|
|
|
namespace benchmark { |
|
|
|
|
|
|
|
|
|
|
|
class State { |
|
|
|
class State { |
|
|
@ -68,4 +69,4 @@ namespace benchmark { |
|
|
|
#define BENCHMARK(n) \ |
|
|
|
#define BENCHMARK(n) \ |
|
|
|
benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))(BOOST_PP_STRINGIZE(n), n); |
|
|
|
benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))(BOOST_PP_STRINGIZE(n), n); |
|
|
|
|
|
|
|
|
|
|
|
#endif // BITCOIN_BENCH_H
|
|
|
|
#endif // BITCOIN_BENCH_BENCH_H
|
|
|
|