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

Issue 183663030: Reduce number of vector buffer reallocs in Regions::unite . (Closed)

Created:
6 years, 9 months ago by ostap
Modified:
6 years, 6 months ago
Reviewers:
danakj, eseidel
CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, Rik, Stephen Chennney, pdr., rwlbuis, Erik Corry, Mikhail, Chris Evans
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Reduce number of vector buffer reallocs in Regions::unite . When acceleratedCompositingForFixedPositionEnabled is not set FrameView::scrollContentsFastPath() performs invalidate for every sticky or fixed layer. Page http://people.mozilla.org/~jorendorff/es6-draft.html#sec-terms-and-definitions-symbol-type causes Region::unite a lot. Vector buffer reallocations are hot in profiler. This patch pre-allocates vector buffers in Region::Shape::shapeOperation() and moves Vector allocation out of inner loop. This significantly reduces number of vector buffer reallocs. BUG=335306 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175822

Patch Set 1 #

Patch Set 2 : Increase initial vector buffer size to sum of source buffers size and add buffer trimming. #

Patch Set 3 : Rebased patch. #

Total comments: 13

Patch Set 4 : Updated by review comments. #

Patch Set 5 : Use new Vector::shrinkToReasonableCapacity() API. #

Total comments: 4

Patch Set 6 : Add assert to check that segments capacity is not zeroed. #

Patch Set 7 : Add back shrinkToReasonableCapacity() change. #

Total comments: 2

Patch Set 8 : Simplify vectore pre-allocating Shape() constructor. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M Source/platform/geometry/Region.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -0 lines 0 comments Download
M Source/platform/geometry/Region.cpp View 1 2 3 4 5 6 7 6 chunks +23 lines, -2 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
ostap
6 years, 9 months ago (2014-03-06 06:54:57 UTC) #1
ostap
Could you take a look? This should improve performance of desktop chromium for pages that ...
6 years, 8 months ago (2014-04-05 21:35:50 UTC) #2
abarth-chromium
1) I'm not the right person to review this CL. We should find someone who ...
6 years, 8 months ago (2014-04-05 21:58:39 UTC) #3
ostap
On 2014/04/05 21:58:39, abarth wrote: > 1) I'm not the right person to review this ...
6 years, 8 months ago (2014-04-06 02:28:11 UTC) #4
abarth-chromium
Neat. We can ask danakj to review the CL. @danakj: Thoughts?
6 years, 8 months ago (2014-04-06 04:26:21 UTC) #5
danakj
I like it overall! yay for reserving memory up front to avoid useless copies. https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp ...
6 years, 8 months ago (2014-04-09 18:39:51 UTC) #6
ostap
https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp#newcode249 Source/platform/geometry/Region.cpp:249: void Region::Shape::trimCapacities() On 2014/04/09 18:39:51, danakj wrote: > Methods ...
6 years, 8 months ago (2014-04-09 22:45:43 UTC) #7
danakj
https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp#newcode252 Source/platform/geometry/Region.cpp:252: m_segments.shrinkToFit(); On 2014/04/09 22:45:43, ostap wrote: > On 2014/04/09 ...
6 years, 8 months ago (2014-04-15 20:15:43 UTC) #8
ostap
On 2014/04/15 20:15:43, danakj wrote: > https://codereview.chromium.org/183663030/diff/40001/Source/platform/geometry/Region.cpp > File Source/platform/geometry/Region.cpp (right): > > Yes, shrinkToReasonableCapacity() ...
6 years, 8 months ago (2014-04-15 22:17:27 UTC) #9
ostap
On 2014/04/06 04:26:21, abarth wrote: > Neat. We can ask danakj to review the CL. ...
6 years, 7 months ago (2014-05-12 19:58:56 UTC) #10
danakj
LGTM https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp#newcode463 Source/platform/geometry/Region.cpp:463: segments.resize(0); Can you assert the capacity after this ...
6 years, 7 months ago (2014-05-12 22:57:08 UTC) #11
ostap
https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp#newcode463 Source/platform/geometry/Region.cpp:463: segments.resize(0); On 2014/05/12 22:57:09, danakj wrote: > Can you ...
6 years, 7 months ago (2014-05-13 19:05:21 UTC) #12
danakj
https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp#newcode463 Source/platform/geometry/Region.cpp:463: segments.resize(0); On 2014/05/13 19:05:21, ostap wrote: > On 2014/05/12 ...
6 years, 7 months ago (2014-05-13 19:09:02 UTC) #13
ostap
https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/80001/Source/platform/geometry/Region.cpp#newcode463 Source/platform/geometry/Region.cpp:463: segments.resize(0); On 2014/05/13 19:09:03, danakj wrote: > On 2014/05/13 ...
6 years, 7 months ago (2014-05-13 20:07:47 UTC) #14
ostap
eseidel@chromium.org: Please review changes since abarth seems not available now.
6 years, 7 months ago (2014-05-21 16:08:51 UTC) #15
eseidel
Region has long been of horrible performance: https://bugs.webkit.org/show_bug.cgi?id=98800 https://bugs.webkit.org/show_bug.cgi?id=79174 (and many more if you search ...
6 years, 6 months ago (2014-05-28 23:58:23 UTC) #16
eseidel
CCing wtf ninjas.
6 years, 6 months ago (2014-05-29 00:00:11 UTC) #17
ostap
On 2014/05/28 23:58:23, eseidel wrote: > Region has long been of horrible performance: > https://bugs.webkit.org/show_bug.cgi?id=98800 ...
6 years, 6 months ago (2014-05-29 02:27:48 UTC) #18
eseidel
https://codereview.chromium.org/183663030/diff/120001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/120001/Source/platform/geometry/Region.cpp#newcode245 Source/platform/geometry/Region.cpp:245: segmentsCapacity = (segmentsCapacity + segmentsMask) & ~segmentsMask; Why is ...
6 years, 6 months ago (2014-05-29 15:45:15 UTC) #19
ostap
https://codereview.chromium.org/183663030/diff/120001/Source/platform/geometry/Region.cpp File Source/platform/geometry/Region.cpp (right): https://codereview.chromium.org/183663030/diff/120001/Source/platform/geometry/Region.cpp#newcode245 Source/platform/geometry/Region.cpp:245: segmentsCapacity = (segmentsCapacity + segmentsMask) & ~segmentsMask; On 2014/05/29 ...
6 years, 6 months ago (2014-05-29 22:35:21 UTC) #20
eseidel
lgtm This seems very reasonable to me. We can always iterate further from here. Do ...
6 years, 6 months ago (2014-05-30 00:03:30 UTC) #21
ostap
On 2014/05/30 00:03:30, eseidel wrote: > lgtm > > This seems very reasonable to me. ...
6 years, 6 months ago (2014-05-30 02:32:52 UTC) #22
ostap
The CQ bit was checked by sl.ostapenko@samsung.com
6 years, 6 months ago (2014-06-09 21:19:17 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sl.ostapenko@samsung.com/183663030/140001
6 years, 6 months ago (2014-06-09 21:20:18 UTC) #24
commit-bot: I haz the power
6 years, 6 months ago (2014-06-09 21:28:37 UTC) #25
Message was sent while issue was closed.
Change committed as 175822

Powered by Google App Engine
This is Rietveld 408576698