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

Issue 14746019: net/disk_cache/simple: Reduce size of EntrySet nodes. (Closed)

Created:
7 years, 7 months ago by digit1
Modified:
7 years, 6 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

net/disk_cache/simple: Reduce size of EntrySet nodes. The EntrySet type was a base::hash_map that duplicated the hash_key value in both the key and value types, wasting 8 bytes per node. Changing the implementation to a base::hash_set has been experimented with and introduces lots of non trivial code changes (some of them being dependent on the exact C++ STL implementation). This is a simpler optimization that simply puts the hash_key out of the EntryMetadata structure, and updates all related code appropriately. Note that this only changes the in-memory representation of the index, the on-disk format is untouched. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203166

Patch Set 1 #

Patch Set 2 : Fix two failing unit tests #

Total comments: 8

Patch Set 3 : #

Patch Set 4 : remove comment #

Total comments: 4

Patch Set 5 : simple rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -80 lines) Patch
M net/disk_cache/simple/simple_index.h View 3 chunks +3 lines, -6 lines 1 comment Download
M net/disk_cache/simple/simple_index.cc View 1 2 3 8 chunks +26 lines, -44 lines 0 comments Download
M net/disk_cache/simple/simple_index_file.cc View 2 chunks +6 lines, -2 lines 0 comments Download
M net/disk_cache/simple/simple_index_file_unittest.cc View 1 2 2 chunks +16 lines, -15 lines 0 comments Download
M net/disk_cache/simple/simple_index_unittest.cc View 1 6 chunks +7 lines, -13 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
digit1
7 years, 7 months ago (2013-05-16 13:30:05 UTC) #1
gavinp
+rdsmith (FYI, as this might collide with some of your work) https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc File net/disk_cache/simple/simple_index.cc (right): ...
7 years, 7 months ago (2013-05-16 13:38:01 UTC) #2
digit1
https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc File net/disk_cache/simple/simple_index.cc (right): https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc#newcode241 net/disk_cache/simple/simple_index.cc:241: InsertInEntrySet( It's a public function that is also called ...
7 years, 7 months ago (2013-05-16 15:31:01 UTC) #3
pasko
Thanks, David. LGTM with a few suggestions to help a less capable brain (like mine?) ...
7 years, 7 months ago (2013-05-16 18:13:21 UTC) #4
pasko-google - do not use
one nit: net/disk_cache_simple -> net/disk_cache/simple or just "Simple Cache: " as prefix
7 years, 7 months ago (2013-05-16 18:24:41 UTC) #5
digit1
https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc File net/disk_cache/simple/simple_index.cc (left): https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc#oldcode230 net/disk_cache/simple/simple_index.cc:230: EntryMetadata metadata = it->second; Sure, no problem. Done. https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index_file_unittest.cc ...
7 years, 7 months ago (2013-05-17 08:45:38 UTC) #6
digit1
https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc File net/disk_cache/simple/simple_index.cc (right): https://chromiumcodereview.appspot.com/14746019/diff/6001/net/disk_cache/simple/simple_index.cc#newcode544 net/disk_cache/simple/simple_index.cc:544: // merge the new data there with the data ...
7 years, 7 months ago (2013-05-17 08:46:59 UTC) #7
pasko
lgtm again, you'll also need an lg from Gavin or another net/ owner.
7 years, 7 months ago (2013-05-17 09:21:33 UTC) #8
felipeg
On 2013/05/17 09:21:33, pasko wrote: > lgtm again, you'll also need an lg from Gavin ...
7 years, 7 months ago (2013-05-17 13:56:51 UTC) #9
gavinp
lgtm. Thanks for taking the effort here! Please keep these coming if you feel the ...
7 years, 7 months ago (2013-05-17 14:54:17 UTC) #10
digit1
https://chromiumcodereview.appspot.com/14746019/diff/22002/net/disk_cache/simple/simple_index_file_unittest.cc File net/disk_cache/simple/simple_index_file_unittest.cc (right): https://chromiumcodereview.appspot.com/14746019/diff/22002/net/disk_cache/simple/simple_index_file_unittest.cc#newcode63 net/disk_cache/simple/simple_index_file_unittest.cc:63: static const uint64 kHashes[] = { 11, 22, 33 ...
7 years, 7 months ago (2013-05-17 15:07:32 UTC) #11
gavinp
lgtm still stands https://chromiumcodereview.appspot.com/14746019/diff/22002/net/disk_cache/simple/simple_index_file_unittest.cc File net/disk_cache/simple/simple_index_file_unittest.cc (right): https://chromiumcodereview.appspot.com/14746019/diff/22002/net/disk_cache/simple/simple_index_file_unittest.cc#newcode63 net/disk_cache/simple/simple_index_file_unittest.cc:63: static const uint64 kHashes[] = { ...
7 years, 7 months ago (2013-05-17 15:37:45 UTC) #12
gavinp
Will we be landing this?
7 years, 7 months ago (2013-05-21 16:41:49 UTC) #13
digit1
On 2013/05/21 16:41:49, gavinp wrote: > Will we be landing this? Yes, sorry, I was ...
7 years, 6 months ago (2013-05-30 12:51:41 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/digit@chromium.org/14746019/38001
7 years, 6 months ago (2013-05-30 13:26:04 UTC) #15
commit-bot: I haz the power
Change committed as 203166
7 years, 6 months ago (2013-05-30 17:04:09 UTC) #16
rvargas (doing something else)
7 years, 6 months ago (2013-05-30 18:02:53 UTC) #17
Message was sent while issue was closed.
Sounds good but I'm not familiar with this code to do a meaningful review so
instead of nitpicking I'll just defer to the other reviewers.

https://codereview.chromium.org/14746019/diff/38001/net/disk_cache/simple/sim...
File net/disk_cache/simple/simple_index.h (right):

https://codereview.chromium.org/14746019/diff/38001/net/disk_cache/simple/sim...
net/disk_cache/simple/simple_index.h:104: // TODO(felipeg): This way we are
storing the hash_key twice, as the
Remove this todo.

Powered by Google App Engine
This is Rietveld 408576698