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

Issue 7190032: Shrink dictionaries on deletion if number of elements are less than a (Closed)

Created:
9 years, 6 months ago by Mads Ager (chromium)
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Shrink dictionaries on deletion if number of elements are less than a quarter of the capacity. R=vegorov@chromium.org Committed: http://code.google.com/p/v8/source/detail?r=8391

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -27 lines) Patch
M src/objects.h View 2 chunks +9 lines, -0 lines 0 comments Download
M src/objects.cc View 1 8 chunks +103 lines, -27 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (chromium)
9 years, 6 months ago (2011-06-22 14:31:11 UTC) #1
Vyacheslav Egorov (Chromium)
LGTM with the comment addressed. http://codereview.chromium.org/7190032/diff/1/src/objects.cc File src/objects.cc (right): http://codereview.chromium.org/7190032/diff/1/src/objects.cc#newcode10052 src/objects.cc:10052: if (new_capacity < 16) ...
9 years, 6 months ago (2011-06-22 14:39:36 UTC) #2
Mads Ager (chromium)
9 years, 6 months ago (2011-06-22 14:55:20 UTC) #3
Thanks Slava!

http://codereview.chromium.org/7190032/diff/1/src/objects.cc
File src/objects.cc (right):

http://codereview.chromium.org/7190032/diff/1/src/objects.cc#newcode10052
src/objects.cc:10052: if (new_capacity < 16) return this;
On 2011/06/22 14:39:36, Vyacheslav Egorov wrote:
> This is a bit strange. 
> 
> I would ensure that (new_capacity >= 2 * nof) otherwise will get another
> rehashing immediately when we try to add a new element after Shrink'ing. Also
> not very good for conflicts.

Ah, I actually mean this. However, I did not mean new_capacity to be capacity >>
2. I meant it to be capacity >> 1. Since nof can be zero I want to make sure
that we do not go below 16.

Powered by Google App Engine
This is Rietveld 408576698