mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-09 16:52:40 -05:00
Optimized RandomX initialization and switching.
This commit is contained in:
@@ -64,16 +64,8 @@ xmrig::RxDataset::~RxDataset()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::RxDataset::init(const void *seed, const Algorithm &algorithm, uint32_t numThreads)
|
||||
bool xmrig::RxDataset::init(const void *seed, uint32_t numThreads)
|
||||
{
|
||||
if (isReady(seed, algorithm)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_algorithm != algorithm) {
|
||||
m_algorithm = RxAlgo::apply(algorithm);
|
||||
}
|
||||
|
||||
cache()->init(seed);
|
||||
|
||||
if (!get()) {
|
||||
@@ -104,12 +96,6 @@ bool xmrig::RxDataset::init(const void *seed, const Algorithm &algorithm, uint32
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::RxDataset::isReady(const void *seed, const Algorithm &algorithm) const
|
||||
{
|
||||
return algorithm == m_algorithm && cache()->isReady(seed);
|
||||
}
|
||||
|
||||
|
||||
std::pair<size_t, size_t> xmrig::RxDataset::hugePages() const
|
||||
{
|
||||
constexpr size_t twoMiB = 2u * 1024u * 1024u;
|
||||
|
||||
Reference in New Issue
Block a user