mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Reduce SHAMapTreeNode copying during SHAMap unsharing:
In some code paths, we bump the SHAMap sequence number before we unshare. This forces SHAMapTreeNode to be copied. By making the ledger immutable we cause the unsharing to occur earlier, eliminating the copies.
This commit is contained in:
@@ -1084,6 +1084,7 @@ void ApplicationImp::startNewLedger ()
|
||||
firstLedger->updateHash ();
|
||||
firstLedger->setClosed ();
|
||||
firstLedger->setAccepted ();
|
||||
firstLedger->setImmutable();
|
||||
m_ledgerMaster->pushLedger (firstLedger);
|
||||
|
||||
Ledger::pointer secondLedger = std::make_shared<Ledger> (true, std::ref (*firstLedger));
|
||||
|
||||
Reference in New Issue
Block a user