From 328f985e0730f6b8f5f20e7ce5188449934f78f6 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 17 Oct 2020 04:03:42 +0700 Subject: [PATCH] Added Benchmark class. --- src/backend/common/Benchmark.cpp | 103 ++++++++++++ src/backend/common/Benchmark.h | 62 +++++++ src/backend/common/Workers.cpp | 202 ++++++++++------------- src/backend/common/Workers.h | 10 +- src/backend/common/common.cmake | 5 + src/backend/common/interfaces/IBackend.h | 6 + src/backend/cpu/CpuBackend.cpp | 22 +++ src/backend/cpu/CpuBackend.h | 5 + src/backend/cuda/CudaBackend.h | 5 + src/backend/opencl/OclBackend.h | 5 + src/base/io/log/Tags.cpp | 2 +- src/base/net/stratum/Pool.cpp | 3 - src/base/net/stratum/Pool.h | 2 - src/core/Miner.cpp | 70 ++++---- 14 files changed, 346 insertions(+), 156 deletions(-) create mode 100644 src/backend/common/Benchmark.cpp create mode 100644 src/backend/common/Benchmark.h diff --git a/src/backend/common/Benchmark.cpp b/src/backend/common/Benchmark.cpp new file mode 100644 index 000000000..f87eeba2c --- /dev/null +++ b/src/backend/common/Benchmark.cpp @@ -0,0 +1,103 @@ +/* XMRig + * Copyright (c) 2018-2020 SChernykh + * Copyright (c) 2016-2020 XMRig , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include "backend/common/Benchmark.h" +#include "backend/common/interfaces/IWorker.h" +#include "base/io/log/Log.h" +#include "base/io/log/Tags.h" +#include "base/tools/Chrono.h" + + +#include + + +namespace xmrig { + + +static uint64_t hashCheck[2][10] = { + { 0x898B6E0431C28A6BULL, 0xEE9468F8B40926BCULL, 0xC2BC5D11724813C0ULL, 0x3A2C7B285B87F941ULL, 0x3B5BD2C3A16B450EULL, 0x5CD0602F20C5C7C4ULL, 0x101DE939474B6812ULL, 0x52B765A1B156C6ECULL, 0x323935102AB6B45CULL, 0xB5231262E2792B26ULL }, + { 0x0F3E5400B39EA96AULL, 0x85944CCFA2752D1FULL, 0x64AFFCAE991811BAULL, 0x3E4D0B836D3B13BAULL, 0xEB7417D621271166ULL, 0x97FFE10C0949FFA5ULL, 0x84CAC0F8879A4BA1ULL, 0xA1B79F031DA2459FULL, 0x9B65226DA873E65DULL, 0x0F9E00C5A511C200ULL }, +}; + + +} // namespace xmrig + + +bool xmrig::Benchmark::finish(uint64_t totalHashCount) +{ + m_reset = true; + m_current = totalHashCount; + + if (m_done < m_workers) { + return false; + } + + const double dt = (m_doneTime - m_startTime) / 1000.0; + uint64_t checkData = 0; + const uint32_t N = (m_end / 1000000) - 1; + + if (((m_algo == Algorithm::RX_0) || (m_algo == Algorithm::RX_WOW)) && ((m_end % 1000000) == 0) && (N < 10)) { + checkData = hashCheck[(m_algo == Algorithm::RX_0) ? 0 : 1][N]; + } + + const char *color = checkData ? ((m_data == checkData) ? GREEN_BOLD_S : RED_BOLD_S) : BLACK_BOLD_S; + + LOG_NOTICE("%s " WHITE_BOLD("benchmark finished in ") CYAN_BOLD("%.3f seconds") WHITE_BOLD_S " hash sum = " CLEAR "%s%016" PRIX64 CLEAR, Tags::bench(), dt, color, m_data); + LOG_INFO("%s " WHITE_BOLD("press ") MAGENTA_BOLD("Ctrl+C") WHITE_BOLD(" to exit"), Tags::bench()); + + return true; +} + + +void xmrig::Benchmark::start() +{ + m_startTime = Chrono::steadyMSecs(); +} + + +void xmrig::Benchmark::printProgress() const +{ + if (!m_startTime || !m_current) { + return; + } + + const double dt = (Chrono::steadyMSecs() - m_startTime) / 1000.0; + const double percent = static_cast(m_current) / m_end * 100.0; + + LOG_NOTICE("%s " MAGENTA_BOLD("%5.2f%% ") CYAN_BOLD("%" PRIu64) CYAN("/%" PRIu64) BLACK_BOLD(" (%.3fs)"), Tags::bench(), percent, m_current, m_end, dt); +} + + +void xmrig::Benchmark::tick(IWorker *worker) +{ + if (m_reset) { + m_data = 0; + m_done = 0; + m_reset = false; + } + + const uint64_t doneTime = worker->benchDoneTime(); + if (!doneTime) { + return; + } + + ++m_done; + m_data ^= worker->benchData(); + m_doneTime = std::max(doneTime, m_doneTime); +} diff --git a/src/backend/common/Benchmark.h b/src/backend/common/Benchmark.h new file mode 100644 index 000000000..833d5fe32 --- /dev/null +++ b/src/backend/common/Benchmark.h @@ -0,0 +1,62 @@ +/* XMRig + * Copyright (c) 2018-2020 SChernykh + * Copyright (c) 2016-2020 XMRig , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef XMRIG_BENCHMARK_H +#define XMRIG_BENCHMARK_H + + +#include "base/tools/Object.h" +#include "base/crypto/Algorithm.h" + + +namespace xmrig { + + +class IWorker; + + +class Benchmark +{ +public: + XMRIG_DISABLE_COPY_MOVE_DEFAULT(Benchmark) + + Benchmark(uint32_t end, const Algorithm &algo, size_t workers) : m_algo(algo), m_workers(workers), m_end(end) {} + ~Benchmark() = default; + + bool finish(uint64_t totalHashCount); + void printProgress() const; + void start(); + void tick(IWorker *worker); + +private: + bool m_reset = false; + const Algorithm m_algo = Algorithm::RX_0; + const size_t m_workers = 0; + const uint64_t m_end = 0; + uint32_t m_done = 0; + uint64_t m_current = 0; + uint64_t m_data = 0; + uint64_t m_doneTime = 0; + uint64_t m_startTime = 0; +}; + + +} // namespace xmrig + + +#endif /* XMRIG_BENCHMARK_H */ diff --git a/src/backend/common/Workers.cpp b/src/backend/common/Workers.cpp index 1659d7302..272cfb59e 100644 --- a/src/backend/common/Workers.cpp +++ b/src/backend/common/Workers.cpp @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,6 +46,11 @@ #endif +#ifdef XMRIG_FEATURE_BENCHMARK +# include "backend/common/Benchmark.h" +#endif + + namespace xmrig { @@ -55,23 +60,12 @@ public: XMRIG_DISABLE_COPY_MOVE(WorkersPrivate) - WorkersPrivate() = default; + WorkersPrivate() = default; + ~WorkersPrivate() = default; - - inline ~WorkersPrivate() - { - delete hashrate; - } - - - Hashrate *hashrate = nullptr; - IBackend *backend = nullptr; - -# ifdef XMRIG_FEATURE_BENCHMARK - Algorithm benchAlgo = Algorithm::RX_0; - uint32_t bench = 0; - uint64_t startTime = 0; -# endif + IBackend *backend = nullptr; + std::shared_ptr benchmark; + std::shared_ptr hashrate; }; @@ -94,67 +88,9 @@ xmrig::Workers::~Workers() template -const xmrig::Hashrate *xmrig::Workers::hashrate() const +xmrig::Benchmark *xmrig::Workers::benchmark() const { - return d_ptr->hashrate; -} - - -template -void xmrig::Workers::setBackend(IBackend *backend) -{ - d_ptr->backend = backend; -} - - -template -void xmrig::Workers::start(const std::vector &data) -{ -# ifdef XMRIG_FEATURE_BENCHMARK - if (!data.empty()) { - d_ptr->bench = data.front().benchSize; - d_ptr->benchAlgo = data.front().algorithm; - } -# endif - - for (const T &item : data) { - m_workers.push_back(new Thread(d_ptr->backend, m_workers.size(), item)); - } - - d_ptr->hashrate = new Hashrate(m_workers.size()); - Nonce::touch(T::backend()); - - for (Thread *worker : m_workers) { - worker->start(Workers::onReady); - -# ifdef XMRIG_FEATURE_BENCHMARK - if (!d_ptr->bench) -# endif - { - std::this_thread::sleep_for(std::chrono::milliseconds(20)); - } - } - -# ifdef XMRIG_FEATURE_BENCHMARK - d_ptr->startTime = Chrono::steadyMSecs(); -# endif -} - - -template -void xmrig::Workers::stop() -{ - Nonce::stop(T::backend()); - - for (Thread *worker : m_workers) { - delete worker; - } - - m_workers.clear(); - Nonce::touch(T::backend()); - - delete d_ptr->hashrate; - d_ptr->hashrate = nullptr; + return d_ptr->benchmark.get(); } @@ -183,14 +119,8 @@ bool xmrig::Workers::tick(uint64_t) bool totalAvailable = true; uint64_t totalHashCount = 0; -# ifdef XMRIG_FEATURE_BENCHMARK - uint32_t benchDone = 0; - uint64_t benchData = 0; - uint64_t benchDoneTime = 0; -# endif - for (Thread *handle : m_workers) { - IWorker* worker = handle->worker(); + IWorker *worker = handle->worker(); if (worker) { uint64_t hashCount; getHashrateData(worker, hashCount, ts); @@ -203,12 +133,8 @@ bool xmrig::Workers::tick(uint64_t) totalHashCount += n; # ifdef XMRIG_FEATURE_BENCHMARK - if (d_ptr->bench && worker->benchDoneTime()) { - ++benchDone; - benchData ^= worker->benchData(); - if (worker->benchDoneTime() > benchDoneTime) { - benchDoneTime = worker->benchDoneTime(); - } + if (d_ptr->benchmark) { + d_ptr->benchmark->tick(worker); } # endif } @@ -219,33 +145,8 @@ bool xmrig::Workers::tick(uint64_t) } # ifdef XMRIG_FEATURE_BENCHMARK - if (d_ptr->bench) { - Pool::benchProgress = std::min(static_cast((totalHashCount * 100U) / d_ptr->bench), 100U); - - if (benchDone == m_workers.size()) { - const double dt = (benchDoneTime - d_ptr->startTime) / 1000.0; - - uint64_t checkData = 0; - - const Algorithm::Id algo = d_ptr->benchAlgo.id(); - const uint32_t N = (d_ptr->bench / 1000000) - 1; - - if (((algo == Algorithm::RX_0) || (algo == Algorithm::RX_WOW)) && ((d_ptr->bench % 1000000) == 0) && (N < 10)) { - static uint64_t hashCheck[2][10] = { - { 0x898B6E0431C28A6BULL, 0xEE9468F8B40926BCULL, 0xC2BC5D11724813C0ULL, 0x3A2C7B285B87F941ULL, 0x3B5BD2C3A16B450EULL, 0x5CD0602F20C5C7C4ULL, 0x101DE939474B6812ULL, 0x52B765A1B156C6ECULL, 0x323935102AB6B45CULL, 0xB5231262E2792B26ULL }, - { 0x0F3E5400B39EA96AULL, 0x85944CCFA2752D1FULL, 0x64AFFCAE991811BAULL, 0x3E4D0B836D3B13BAULL, 0xEB7417D621271166ULL, 0x97FFE10C0949FFA5ULL, 0x84CAC0F8879A4BA1ULL, 0xA1B79F031DA2459FULL, 0x9B65226DA873E65DULL, 0x0F9E00C5A511C200ULL }, - }; - - checkData = hashCheck[(algo == Algorithm::RX_0) ? 0 : 1][N]; - } - - const char* color = checkData ? ((benchData == checkData) ? GREEN_BOLD_S : RED_BOLD_S) : BLACK_BOLD_S; - - LOG_INFO("%s " WHITE_BOLD("benchmark finished in ") CYAN_BOLD("%.3f seconds") WHITE_BOLD_S " hash sum = " CLEAR "%s%016" PRIX64 CLEAR, - Tags::bench(), dt, color, benchData); - - return false; - } + if (d_ptr->benchmark && d_ptr->benchmark->finish(totalHashCount)) { + return false; } # endif @@ -253,6 +154,71 @@ bool xmrig::Workers::tick(uint64_t) } +template +const xmrig::Hashrate *xmrig::Workers::hashrate() const +{ + return d_ptr->hashrate.get(); +} + + +template +void xmrig::Workers::setBackend(IBackend *backend) +{ + d_ptr->backend = backend; +} + + +template +void xmrig::Workers::start(const std::vector &data) +{ +# ifdef XMRIG_FEATURE_BENCHMARK + if (!data.empty() && data.front().benchSize) { + d_ptr->benchmark = std::make_shared(data.front().benchSize, data.front().algorithm, data.size()); + } +# endif + + for (const T &item : data) { + m_workers.push_back(new Thread(d_ptr->backend, m_workers.size(), item)); + } + + d_ptr->hashrate = std::make_shared(m_workers.size()); + Nonce::touch(T::backend()); + + for (Thread *worker : m_workers) { + worker->start(Workers::onReady); + +# ifdef XMRIG_FEATURE_BENCHMARK + if (!d_ptr->benchmark) +# endif + { + std::this_thread::sleep_for(std::chrono::milliseconds(20)); + } + } + +# ifdef XMRIG_FEATURE_BENCHMARK + if (d_ptr->benchmark) { + d_ptr->benchmark->start(); + } +# endif +} + + +template +void xmrig::Workers::stop() +{ + Nonce::stop(T::backend()); + + for (Thread *worker : m_workers) { + delete worker; + } + + m_workers.clear(); + Nonce::touch(T::backend()); + + d_ptr->hashrate.reset(); +} + + template xmrig::IWorker *xmrig::Workers::create(Thread *) { diff --git a/src/backend/common/Workers.h b/src/backend/common/Workers.h index f3dd19288..3b7fa0191 100644 --- a/src/backend/common/Workers.h +++ b/src/backend/common/Workers.h @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett - * Copyright 2018-2019 SChernykh - * Copyright 2016-2019 XMRig , + * Copyright 2018-2020 SChernykh + * Copyright 2016-2020 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,6 +47,7 @@ namespace xmrig { class Hashrate; class WorkersPrivate; class Job; +class Benchmark; template @@ -58,12 +59,13 @@ public: Workers(); ~Workers(); + Benchmark *benchmark() const; + bool tick(uint64_t ticks); const Hashrate *hashrate() const; + void jobEarlyNotification(const Job&); void setBackend(IBackend *backend); void start(const std::vector &data); void stop(); - bool tick(uint64_t ticks); - void jobEarlyNotification(const Job&); private: static IWorker *create(Thread *handle); diff --git a/src/backend/common/common.cmake b/src/backend/common/common.cmake index 832f53ff8..eb1109339 100644 --- a/src/backend/common/common.cmake +++ b/src/backend/common/common.cmake @@ -21,3 +21,8 @@ set(SOURCES_BACKEND_COMMON src/backend/common/Worker.cpp src/backend/common/Workers.cpp ) + +if (WITH_RANDOMX AND WITH_BENCHMARK) + list(APPEND HEADERS_BACKEND_COMMON src/backend/common/Benchmark.h) + list(APPEND SOURCES_BACKEND_COMMON src/backend/common/Benchmark.cpp) +endif() diff --git a/src/backend/common/interfaces/IBackend.h b/src/backend/common/interfaces/IBackend.h index 577213d35..c07ee49a9 100644 --- a/src/backend/common/interfaces/IBackend.h +++ b/src/backend/common/interfaces/IBackend.h @@ -36,6 +36,7 @@ namespace xmrig { class Algorithm; +class Benchmark; class Hashrate; class IApiRequest; class IWorker; @@ -66,6 +67,11 @@ public: virtual rapidjson::Value toJSON(rapidjson::Document &doc) const = 0; virtual void handleRequest(IApiRequest &request) = 0; # endif + +# ifdef XMRIG_FEATURE_BENCHMARK + virtual Benchmark *benchmark() const = 0; + virtual void printBenchProgress() const = 0; +# endif }; diff --git a/src/backend/cpu/CpuBackend.cpp b/src/backend/cpu/CpuBackend.cpp index cac4f85c1..a5c9c406f 100644 --- a/src/backend/cpu/CpuBackend.cpp +++ b/src/backend/cpu/CpuBackend.cpp @@ -55,6 +55,11 @@ #endif +#ifdef XMRIG_FEATURE_BENCHMARK +# include "backend/common/Benchmark.h" +#endif + + namespace xmrig { @@ -459,3 +464,20 @@ void xmrig::CpuBackend::handleRequest(IApiRequest &request) } } #endif + + +#ifdef XMRIG_FEATURE_BENCHMARK +xmrig::Benchmark *xmrig::CpuBackend::benchmark() const +{ + return d_ptr->workers.benchmark(); +} + + +void xmrig::CpuBackend::printBenchProgress() const +{ + auto benchmark = d_ptr->workers.benchmark(); + if (benchmark) { + benchmark->printProgress(); + } +} +#endif diff --git a/src/backend/cpu/CpuBackend.h b/src/backend/cpu/CpuBackend.h index be63f4372..5be933c39 100644 --- a/src/backend/cpu/CpuBackend.h +++ b/src/backend/cpu/CpuBackend.h @@ -70,6 +70,11 @@ protected: void handleRequest(IApiRequest &request) override; # endif +# ifdef XMRIG_FEATURE_BENCHMARK + Benchmark *benchmark() const override; + void printBenchProgress() const override; +# endif + private: CpuBackendPrivate *d_ptr; }; diff --git a/src/backend/cuda/CudaBackend.h b/src/backend/cuda/CudaBackend.h index ce684d5b3..379e9bf18 100644 --- a/src/backend/cuda/CudaBackend.h +++ b/src/backend/cuda/CudaBackend.h @@ -70,6 +70,11 @@ protected: void handleRequest(IApiRequest &request) override; # endif +# ifdef XMRIG_FEATURE_BENCHMARK + inline Benchmark *benchmark() const override { return nullptr; } + inline void printBenchProgress() const override {} +# endif + private: CudaBackendPrivate *d_ptr; }; diff --git a/src/backend/opencl/OclBackend.h b/src/backend/opencl/OclBackend.h index 49325d412..1c196bae6 100644 --- a/src/backend/opencl/OclBackend.h +++ b/src/backend/opencl/OclBackend.h @@ -70,6 +70,11 @@ protected: void handleRequest(IApiRequest &request) override; # endif +# ifdef XMRIG_FEATURE_BENCHMARK + inline Benchmark *benchmark() const override { return nullptr; } + inline void printBenchProgress() const override {} +# endif + private: OclBackendPrivate *d_ptr; }; diff --git a/src/base/io/log/Tags.cpp b/src/base/io/log/Tags.cpp index 77d53078d..3960a14df 100644 --- a/src/base/io/log/Tags.cpp +++ b/src/base/io/log/Tags.cpp @@ -75,7 +75,7 @@ const char *xmrig::Tags::randomx() #ifdef XMRIG_FEATURE_BENCHMARK const char *xmrig::Tags::bench() { - static const char *tag = RED_BG_BOLD(WHITE_BOLD_S " bench "); + static const char *tag = GREEN_BG_BOLD(WHITE_BOLD_S " bench "); return tag; } diff --git a/src/base/net/stratum/Pool.cpp b/src/base/net/stratum/Pool.cpp index 847f4bfb2..761ddc6a2 100644 --- a/src/base/net/stratum/Pool.cpp +++ b/src/base/net/stratum/Pool.cpp @@ -89,9 +89,6 @@ const char *Pool::kBenchmark = "benchmark"; #endif -uint32_t Pool::benchProgress = 0; - - } diff --git a/src/base/net/stratum/Pool.h b/src/base/net/stratum/Pool.h index 5dd749568..0fd69c613 100644 --- a/src/base/net/stratum/Pool.h +++ b/src/base/net/stratum/Pool.h @@ -129,8 +129,6 @@ public: void print() const; # endif - static uint32_t benchProgress; - private: enum Flags { FLAG_ENABLED, diff --git a/src/core/Miner.cpp b/src/core/Miner.cpp index 8711c1cb3..b4e1ec7f6 100644 --- a/src/core/Miner.cpp +++ b/src/core/Miner.cpp @@ -242,30 +242,8 @@ public: # endif - void printHashrate(bool details) + static inline void printProfile() { - char num[16 * 4] = { 0 }; - double speed[3] = { 0.0 }; - - for (auto backend : backends) { - const auto hashrate = backend->hashrate(); - if (hashrate) { - speed[0] += hashrate->calc(Hashrate::ShortInterval); - speed[1] += hashrate->calc(Hashrate::MediumInterval); - speed[2] += hashrate->calc(Hashrate::LargeInterval); - } - - backend->printHashrate(details); - } - - double scale = 1.0; - const char* h = "H/s"; - - if ((speed[0] >= 1e6) || (speed[1] >= 1e6) || (speed[2] >= 1e6) || (maxHashrate[algorithm] >= 1e6)) { - scale = 1e-6; - h = "MH/s"; - } - # ifdef XMRIG_FEATURE_PROFILING ProfileScopeData* data[ProfileScopeData::MAX_DATA_COUNT]; @@ -303,19 +281,55 @@ public: i = n1; } # endif + } - char benchProgress[8] = {}; - if (Pool::benchProgress) { - sprintf(benchProgress, "%3u%% ", Pool::benchProgress); + + void printHashrate(bool details) + { + char num[16 * 4] = { 0 }; + double speed[3] = { 0.0 }; + uint32_t count = 0; + + for (auto backend : backends) { + const auto hashrate = backend->hashrate(); + if (hashrate) { + ++count; + + speed[0] += hashrate->calc(Hashrate::ShortInterval); + speed[1] += hashrate->calc(Hashrate::MediumInterval); + speed[2] += hashrate->calc(Hashrate::LargeInterval); + } + + backend->printHashrate(details); } - LOG_INFO("%s %s" WHITE_BOLD("speed") " 10s/60s/15m " CYAN_BOLD("%s") CYAN(" %s %s ") CYAN_BOLD("%s") " max " CYAN_BOLD("%s %s"), - Tags::miner(), benchProgress, + if (!count) { + return; + } + + printProfile(); + + double scale = 1.0; + const char* h = "H/s"; + + if ((speed[0] >= 1e6) || (speed[1] >= 1e6) || (speed[2] >= 1e6) || (maxHashrate[algorithm] >= 1e6)) { + scale = 1e-6; + h = "MH/s"; + } + + LOG_INFO("%s " WHITE_BOLD("speed") " 10s/60s/15m " CYAN_BOLD("%s") CYAN(" %s %s ") CYAN_BOLD("%s") " max " CYAN_BOLD("%s %s"), + Tags::miner(), Hashrate::format(speed[0] * scale, num, sizeof(num) / 4), Hashrate::format(speed[1] * scale, num + 16, sizeof(num) / 4), Hashrate::format(speed[2] * scale, num + 16 * 2, sizeof(num) / 4), h, Hashrate::format(maxHashrate[algorithm] * scale, num + 16 * 3, sizeof(num) / 4), h ); + +# ifdef XMRIG_FEATURE_BENCHMARK + for (auto backend : backends) { + backend->printBenchProgress(); + } +# endif }