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

Issue 2381613003: Rewrite the while loop in DrawingBuffer::createOrRecycleBitmap (Closed)

Created:
4 years, 2 months ago by xidachen
Modified:
4 years, 2 months ago
CC:
ajuma+watch_chromium.org, blink-reviews, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), jbroman, Justin Novosad, pdr+graphicswatchlist_chromium.org, piman+watch_chromium.org, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rewrite the while loop in DrawingBuffer::createOrRecycleBitmap Right now inside while loop we call Vector::remove() and that requires resizing and copying which is quite expensive. This CL rewrite that for loop by creating a new local Vector, and copy into it all the elements that are not supposed to be removed. Then we swap this local Vector with m_recycledBitmaps. Committed: https://crrev.com/303824133c0cfff4028742fefe453df5bd222ec5 Cr-Commit-Position: refs/heads/master@{#421884}

Patch Set 1 #

Patch Set 2 : fix compile #

Patch Set 3 : changed to std::move_if #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp View 1 2 1 chunk +7 lines, -7 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
xidachen
4 years, 2 months ago (2016-09-29 13:17:35 UTC) #3
jbroman
I don't mean to bikeshed this, but you can save the buffer allocation (without the ...
4 years, 2 months ago (2016-09-29 14:02:57 UTC) #4
xidachen
Now using std::remove_if which is a O(n) operation, PTAL.
4 years, 2 months ago (2016-09-29 15:08:49 UTC) #5
esprehn
lgtm, very futuristic. :)
4 years, 2 months ago (2016-09-29 16:52:26 UTC) #6
danakj
LGTM
4 years, 2 months ago (2016-09-29 18:28:15 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2381613003/40001
4 years, 2 months ago (2016-09-29 18:38:24 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 2 months ago (2016-09-29 18:45:42 UTC) #15
commit-bot: I haz the power
4 years, 2 months ago (2016-09-29 18:48:12 UTC) #17
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/303824133c0cfff4028742fefe453df5bd222ec5
Cr-Commit-Position: refs/heads/master@{#421884}

Powered by Google App Engine
This is Rietveld 408576698