DescriptionGraphicsLayer::removeAllChildren shouldn't be n^2
This CL changes GraphicsLayer::removeAllChildren to be linear in the number of
children instead of n^2. Previously, we were removing the zero-th element of
the vector in a loop, which causes a shift of all the elements of the vector.
Now we walk the vector from the end, which means remove is constant cost.
This code is called during a compositing update if anything changes about the
GraphicsLayer's children. We didn't actually see this code on our profile
because we're not actually changing the GraphicsLayer tree, but it seemed worth
fixing.
R=ojan@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168598
Patch Set 1 #
Messages
Total messages: 5 (0 generated)
|