Avoid some copies in Keeper#85131
Conversation
There was a problem hiding this comment.
Why can we move(children)? Doesn't it make the current object malformed?
There was a problem hiding this comment.
In shallowCopy we copy stats but not children, so getChildren on on object with was obtained via shallowCopy will trigger assert, is it intended?
There was a problem hiding this comment.
It is a bit hacky, when creating snapshot we don't iterate children.
If snapshot is being made, each update of a node will create a copy first and then update it.
Snapshot will use the old node, while every new operation will use new node.
So that's why we can move children from the snapshotted node, we don't need it.
There was a problem hiding this comment.
This deserves a comment.
There was a problem hiding this comment.
As a safety I added asserts on children getters (getChildren)
672e894 to
09f736f
Compare
09f736f to
8c6f6dd
Compare
|
@antonio2368 Wrong category. |
Backport #85131 to 25.7: Avoid some copies in Keeper
Backport #85131 to 25.6: Avoid some copies in Keeper
Backport #85131 to 25.3: Avoid some copies in Keeper
Backport #85131 to 25.5: Avoid some copies in Keeper
Changelog category (leave one):
Documentation entry for user-facing changes