mirror of
https://github.com/monero-project/monero.git
synced 2024-12-14 12:26:31 +02:00
BlockchainLMDB: Add profiling to tx_exists()
This commit is contained in:
parent
83fb6d8d07
commit
6485dacc2f
@ -1126,7 +1126,6 @@ uint64_t BlockchainLMDB::height() const
|
|||||||
return m_height;
|
return m_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BlockchainLMDB::tx_exists(const crypto::hash& h) const
|
bool BlockchainLMDB::tx_exists(const crypto::hash& h) const
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||||
@ -1144,7 +1143,11 @@ bool BlockchainLMDB::tx_exists(const crypto::hash& h) const
|
|||||||
|
|
||||||
MDB_val_copy<crypto::hash> key(h);
|
MDB_val_copy<crypto::hash> key(h);
|
||||||
MDB_val result;
|
MDB_val result;
|
||||||
|
|
||||||
|
TIME_MEASURE_START(time1);
|
||||||
auto get_result = mdb_get(*txn_ptr, m_txs, &key, &result);
|
auto get_result = mdb_get(*txn_ptr, m_txs, &key, &result);
|
||||||
|
TIME_MEASURE_FINISH(time1);
|
||||||
|
time_tx_exists += time1;
|
||||||
if (get_result == MDB_NOTFOUND)
|
if (get_result == MDB_NOTFOUND)
|
||||||
{
|
{
|
||||||
if (! m_batch_active)
|
if (! m_batch_active)
|
||||||
|
@ -149,6 +149,7 @@ void BlockchainDB::reset_stats()
|
|||||||
{
|
{
|
||||||
num_calls = 0;
|
num_calls = 0;
|
||||||
time_blk_hash = 0;
|
time_blk_hash = 0;
|
||||||
|
time_tx_exists = 0;
|
||||||
time_add_block1 = 0;
|
time_add_block1 = 0;
|
||||||
time_add_transaction = 0;
|
time_add_transaction = 0;
|
||||||
time_commit1 = 0;
|
time_commit1 = 0;
|
||||||
@ -163,6 +164,8 @@ void BlockchainDB::show_stats()
|
|||||||
<< ENDL
|
<< ENDL
|
||||||
<< "time_blk_hash: " << time_blk_hash << "ms"
|
<< "time_blk_hash: " << time_blk_hash << "ms"
|
||||||
<< ENDL
|
<< ENDL
|
||||||
|
<< "time_tx_exists: " << time_tx_exists << "ms"
|
||||||
|
<< ENDL
|
||||||
<< "time_add_block1: " << time_add_block1 << "ms"
|
<< "time_add_block1: " << time_add_block1 << "ms"
|
||||||
<< ENDL
|
<< ENDL
|
||||||
<< "time_add_transaction: " << time_add_transaction << "ms"
|
<< "time_add_transaction: " << time_add_transaction << "ms"
|
||||||
|
@ -310,6 +310,7 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
mutable uint64_t time_tx_exists = 0;
|
||||||
uint64_t time_commit1 = 0;
|
uint64_t time_commit1 = 0;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user