Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Issue 187603011: GraphicsLayer::removeAllChildren shouldn't be n^2 (Closed)

Created:
6 years, 9 months ago by abarth-chromium
Modified:
6 years, 9 months ago
Reviewers:
esprehn, ojan
CC:
blink-reviews, jamesr, krit, danakj, dsinclair, jbroman, blink-layers+watch_chromium.org, Rik, Stephen Chennney, pdr., rwlbuis, ojan, Ian Vollick
Visibility:
Public.

Description

GraphicsLayer::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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -10 lines) Patch
Source/platform/graphics/GraphicsLayer.cpp View 2 chunks +4 lines, -10 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
abarth-chromium
6 years, 9 months ago (2014-03-05 23:42:48 UTC) #1
esprehn
lgtm, but we should really just use the Node linked list pattern.
6 years, 9 months ago (2014-03-05 23:59:48 UTC) #2
ojan
The CQ bit was checked by ojan@chromium.org
6 years, 9 months ago (2014-03-06 00:35:21 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/187603011/1
6 years, 9 months ago (2014-03-06 00:35:47 UTC) #4
commit-bot: I haz the power
6 years, 9 months ago (2014-03-06 08:17:51 UTC) #5
Message was sent while issue was closed.
Change committed as 168598

Powered by Google App Engine
This is Rietveld 408576698