Changeset View
Changeset View
Standalone View
Standalone View
src/bench/mempool_eviction.cpp
Show All 10 Lines | |||||
static void AddTx(const CTransactionRef &tx, const Amount &nFee, | static void AddTx(const CTransactionRef &tx, const Amount &nFee, | ||||
CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { | CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main, pool.cs) { | ||||
int64_t nTime = 0; | int64_t nTime = 0; | ||||
unsigned int nHeight = 1; | unsigned int nHeight = 1; | ||||
bool spendsCoinbase = false; | bool spendsCoinbase = false; | ||||
unsigned int nSigOpCount = 1; | unsigned int nSigOpCount = 1; | ||||
LockPoints lp; | LockPoints lp; | ||||
pool.addUnchecked(tx->GetId(), | pool.addUnchecked(CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, | ||||
CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, | |||||
nSigOpCount, lp)); | nSigOpCount, lp)); | ||||
} | } | ||||
// Right now this is only testing eviction performance in an extremely small | // Right now this is only testing eviction performance in an extremely small | ||||
// mempool. Code needs to be written to generate a much wider variety of | // mempool. Code needs to be written to generate a much wider variety of | ||||
// unique transactions for a more meaningful performance measurement. | // unique transactions for a more meaningful performance measurement. | ||||
static void MempoolEviction(benchmark::State &state) { | static void MempoolEviction(benchmark::State &state) { | ||||
CMutableTransaction tx1 = CMutableTransaction(); | CMutableTransaction tx1 = CMutableTransaction(); | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |