Skip to content

Commit

Permalink
Temporary update for --test option.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jun 23, 2024
1 parent 698082b commit b2a1aa9
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions console/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,48 @@ void executor::scan_collisions() const
spend.shrink_to_fit();
}

////// arbitrary testing (const).
////void executor::read_test() const
////{
//// logger("No read test implemented.");
////}
// arbitrary testing (const).
void executor::read_test() const
{
auto start = fine_clock::now();
auto count = query_.header_records();
uint32_t block{ one };

logger("Find strong blocks.");
while (!cancel_ && (block < count) && query_.is_strong_block(block))
{
++block;
}

auto span = duration_cast<milliseconds>(fine_clock::now() - start);
logger(format("Top strong block is [%1%] in [%2%] ms.") % sub1(block) % span.count());
start = fine_clock::now();
count = query_.header_records();
uint32_t milestone{ 295'001 };

logger("Find milestone blocks.");
while (!cancel_ && (milestone < count) && query_.is_milestone(milestone))
{
++milestone;
}

span = duration_cast<milliseconds>(fine_clock::now() - start);
logger(format("Top milestone block is [%1%] in [%2%] ms.") % sub1(milestone) % span.count());
start = fine_clock::now();
uint32_t tx{ one };

logger("Find strong txs.");
count = query_.tx_records();
while (!cancel_ && (tx < count) && query_.is_strong_tx(tx) )
{
++tx;
}

span = duration_cast<milliseconds>(fine_clock::now() - start);
logger(format("Top strong tx is [%1%] in [%2%] ms.") % sub1(tx) % span.count());
}

#if defined(UNDEFINED)

void executor::read_test() const
{
Expand Down Expand Up @@ -1037,8 +1074,6 @@ void executor::read_test() const
#endif // UNDEFINED
}

#if defined(UNDEFINED)

void executor::read_test() const
{
logger("Wire size computation.");
Expand Down

0 comments on commit b2a1aa9

Please sign in to comment.