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

Issue 239603005: Add method Vector::shrinkToReasonableCapacity() (Closed)

Created:
6 years, 8 months ago by ostap
Modified:
6 years, 7 months ago
CC:
blink-reviews, adamk+blink_chromium.org, Inactive, abarth-chromium
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Add method Vector::shrinkToReasonableCapacity() Shrinks vector capacity to the vector size if capacity is excessivly big. BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173420

Patch Set 1 #

Total comments: 3

Patch Set 2 : Leave some extra capacity in vector after shrinking and add UNLIKELY to the condition. #

Total comments: 4

Patch Set 3 : Remove UNLIKELY macro from condition. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M Source/wtf/Vector.h View 1 2 1 chunk +5 lines, -0 lines 1 comment Download

Messages

Total messages: 17 (0 generated)
ostap
By the discussion from here: https://codereview.chromium.org/183663030/
6 years, 8 months ago (2014-04-15 22:16:42 UTC) #1
danakj
https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h#newcode681 Source/wtf/Vector.h:681: shrinkToFit(); How about: shrinkCapacity(size() * 2)? So a series ...
6 years, 8 months ago (2014-04-15 22:21:40 UTC) #2
ostap
https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h#newcode681 Source/wtf/Vector.h:681: shrinkToFit(); On 2014/04/15 22:21:40, danakj wrote: > How about: ...
6 years, 8 months ago (2014-04-15 22:46:34 UTC) #3
danakj
https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h#newcode681 Source/wtf/Vector.h:681: shrinkToFit(); On 2014/04/15 22:46:34, ostap wrote: > On 2014/04/15 ...
6 years, 8 months ago (2014-04-15 22:53:25 UTC) #4
ostap
On 2014/04/15 22:53:25, danakj wrote: > https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h > File Source/wtf/Vector.h (right): > > https://codereview.chromium.org/239603005/diff/1/Source/wtf/Vector.h#newcode681 > ...
6 years, 8 months ago (2014-04-15 23:17:15 UTC) #5
abarth-chromium
https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h#newcode680 Source/wtf/Vector.h:680: if (UNLIKELY(size() * 2 < capacity())) Sorry to leave ...
6 years, 8 months ago (2014-04-16 00:58:38 UTC) #6
Mikhail
https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h#newcode678 Source/wtf/Vector.h:678: void shrinkToReasonableCapacity() Is this method supposed to be called ...
6 years, 8 months ago (2014-04-16 08:29:13 UTC) #7
danakj
LGTM % abarth and/or OWNERS. https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h#newcode678 Source/wtf/Vector.h:678: void shrinkToReasonableCapacity() On 2014/04/16 ...
6 years, 8 months ago (2014-04-16 15:55:06 UTC) #8
ostap
On 2014/04/16 08:29:13, mikhail.pozdnyakov wrote: > https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h > File Source/wtf/Vector.h (right): > > https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h#newcode678 > ...
6 years, 8 months ago (2014-04-16 16:04:15 UTC) #9
ostap
https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h#newcode680 Source/wtf/Vector.h:680: if (UNLIKELY(size() * 2 < capacity())) On 2014/04/16 00:58:38, ...
6 years, 8 months ago (2014-04-16 16:11:02 UTC) #10
Mikhail
On 2014/04/16 16:04:15, ostap wrote: > On 2014/04/16 08:29:13, mikhail.pozdnyakov wrote: > > https://codereview.chromium.org/239603005/diff/20001/Source/wtf/Vector.h > ...
6 years, 8 months ago (2014-04-16 21:06:07 UTC) #11
danakj
On Wed, Apr 16, 2014 at 5:06 PM, <mikhail.pozdnyakov@intel.com> wrote: > On 2014/04/16 16:04:15, ostap ...
6 years, 8 months ago (2014-04-16 21:15:04 UTC) #12
abarth-chromium
https://codereview.chromium.org/239603005/diff/40001/Source/wtf/Vector.h File Source/wtf/Vector.h (right): https://codereview.chromium.org/239603005/diff/40001/Source/wtf/Vector.h#newcode681 Source/wtf/Vector.h:681: shrinkCapacity(size() + size() / 4 + 1); Is there ...
6 years, 8 months ago (2014-04-17 19:21:35 UTC) #13
ostap
On 2014/04/17 19:21:35, abarth wrote: > https://codereview.chromium.org/239603005/diff/40001/Source/wtf/Vector.h > File Source/wtf/Vector.h (right): > > https://codereview.chromium.org/239603005/diff/40001/Source/wtf/Vector.h#newcode681 > ...
6 years, 8 months ago (2014-04-17 21:34:43 UTC) #14
abarth-chromium
lgtm
6 years, 7 months ago (2014-05-06 18:50:47 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sl.ostapenko@samsung.com/239603005/40001
6 years, 7 months ago (2014-05-06 18:51:22 UTC) #16
commit-bot: I haz the power
6 years, 7 months ago (2014-05-06 20:00:36 UTC) #17
Message was sent while issue was closed.
Change committed as 173420

Powered by Google App Engine
This is Rietveld 408576698