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:
@@ -75,7 +75,7 @@ SHAMap::snapShot (bool isMutable) const
|
||||
newMap.seq_ = seq_ + 1;
|
||||
newMap.root_ = root_;
|
||||
|
||||
if ((state_ != SHAMapState::Immutable) || !isMutable)
|
||||
if ((state_ != SHAMapState::Immutable) || isMutable)
|
||||
{
|
||||
// If either map may change, they cannot share nodes
|
||||
newMap.unshare ();
|
||||
|
||||
Reference in New Issue
Block a user