DescriptionSync: MutableEntry shouldn't track changes that have no actual impact on the stored data
This change optimizes MutableEntry and ModelNeutralMutableEntry
methods that update sync data. Most of these methods compare
new and old values and skip the update when the values match.
However most of these methods still unconditionally register EntryKernel
to be tracked in EntryKernelMutation list by making a TrackChangesTo
call, which immediately makes a deep copy of EntryKernel.
Then there is one more deep copy at the end of the
transaction scope.
This fix avoids the two unnecessary deep copies by calling
TrackChangesTo only when necessary e.g. when the new value
is actually different.
In addition I used this as an opportunity to do a small code cleanup around
marking MutableEntry instances as dirty.
BUG=468144
Committed: https://crrev.com/193873c7e382f11bf09b6739d07ac82e9dd14fd7
Cr-Commit-Position: refs/heads/master@{#339162}
Patch Set 1 : #
Messages
Total messages: 13 (5 generated)
|