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

Issue 1977863003: SimpleCache: open with fewer seeks. (Closed)

Created:
4 years, 7 months ago by gavinp
Modified:
4 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@open-speeder-macbetter
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

SimpleCache: open with fewer seeks. There's usually no reason to read the file header before reading the stream 0 (headers) data when opening a simple cache entry. By not doing so, seeks in the critical path of the loading headers are reduced, which should speed up http caching performance. To be careful, the headers are still checked when the first read of data (if any) is performed. This delays detecting hash collisions in the cache, because the header data is required to compare keys (instead of just hashes). To compensate for the later key comparison, a SHA256 of the key is stored as an optional prefix to the end of file record. This is used to validate the key is correct before returning headers to the client. Because the key checking logic is now totally migrated back into the SimpleSynchronousEntry, we can return to reporting on key matching in the SyncOpenResult histograms. R=juliatuttle@chromium.org,asvitkine@chromium.org,rdsmith@chromium.org BUG=611732 Committed: https://crrev.com/9f15f2258d7cae8cd12cb4ef7143ad648a958333 Cr-Commit-Position: refs/heads/master@{#395083}

Patch Set 1 #

Patch Set 2 : cleaner, check header eventually #

Patch Set 3 : cleaner still #

Patch Set 4 : self reviewed #

Total comments: 2

Patch Set 5 : move obsolete section #

Total comments: 26

Patch Set 6 : add unit test #

Patch Set 7 : remediate #

Total comments: 5

Patch Set 8 : second round remediation #

Patch Set 9 : eliminate dead conditional #

Patch Set 10 : moar remediation #

Patch Set 11 : add a key SHA256 check #

Total comments: 4

Patch Set 12 : better histograms #

Patch Set 13 : fix histograms.xml #

Patch Set 14 : histogram suffixes #

Total comments: 10

Patch Set 15 : add unit tests #

Total comments: 8

Patch Set 16 : remediate to review #

Patch Set 17 : speeeling #

Patch Set 18 : fix leak in unittest #

Patch Set 19 : fix entry corruption test #

Patch Set 20 : actually fix test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+561 lines, -231 lines) Patch
M net/disk_cache/backend_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +30 lines, -5 lines 0 comments Download
M net/disk_cache/entry_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +79 lines, -6 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.cc View 1 2 2 chunks +1 line, -31 lines 0 comments Download
M net/disk_cache/simple/simple_entry_format.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +9 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.cc View 1 2 3 4 5 6 7 3 chunks +13 lines, -16 lines 0 comments Download
M net/disk_cache/simple/simple_synchronous_entry.h View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +45 lines, -23 lines 0 comments Download
M net/disk_cache/simple/simple_synchronous_entry.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 30 chunks +249 lines, -129 lines 0 comments Download
M net/disk_cache/simple/simple_test_util.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +8 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_test_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +77 lines, -4 lines 0 comments Download
M net/disk_cache/simple/simple_util.h View 1 1 chunk +8 lines, -4 lines 0 comments Download
M net/disk_cache/simple/simple_util.cc View 1 1 chunk +9 lines, -7 lines 0 comments Download
M net/disk_cache/simple/simple_util_unittest.cc View 3 chunks +6 lines, -5 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +22 lines, -1 line 0 comments Download

Messages

Total messages: 48 (17 generated)
gavinp
Looks promising: MacOS shows a 30% improvement on cold reads of headers, Linux shows a ...
4 years, 7 months ago (2016-05-13 19:16:48 UTC) #1
gavinp
ptal
4 years, 7 months ago (2016-05-16 16:23:35 UTC) #4
Alexei Svitkine (slow)
histograms lgtm https://codereview.chromium.org/1977863003/diff/60001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1977863003/diff/60001/tools/metrics/histograms/histograms.xml#newcode50479 tools/metrics/histograms/histograms.xml:50479: + <obsolete> Nit: I think this goes ...
4 years, 7 months ago (2016-05-16 16:47:13 UTC) #5
gavinp
Thanks for the quick review Alexei https://codereview.chromium.org/1977863003/diff/60001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1977863003/diff/60001/tools/metrics/histograms/histograms.xml#newcode50479 tools/metrics/histograms/histograms.xml:50479: + <obsolete> On ...
4 years, 7 months ago (2016-05-16 17:16:26 UTC) #6
gavinp
https://codereview.chromium.org/1977863003/diff/80001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/1977863003/diff/80001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode959 net/disk_cache/simple/simple_synchronous_entry.cc:959: size_t expected_header_size = GetHeaderSize(header->key_length); I think this needs a ...
4 years, 7 months ago (2016-05-16 23:19:28 UTC) #7
gavinp
rdsmith: I think juliatuttle is out. Can you PTAL?
4 years, 7 months ago (2016-05-17 16:27:57 UTC) #10
Randy Smith (Not in Mondays)
This looks like goodness, though admittedly subtle goodness :-}. I haven't reviewed the tests yet ...
4 years, 7 months ago (2016-05-17 20:04:08 UTC) #11
gavinp
Randy, Thanks for your review; I've now addressed your comments. As well, there's now a ...
4 years, 7 months ago (2016-05-18 15:46:01 UTC) #13
Randy Smith (Not in Mondays)
Ok, at a detailed level I'm good with this CL, with the nits below. I'd ...
4 years, 7 months ago (2016-05-18 16:41:30 UTC) #14
gavinp
On 2016/05/18 16:41:30, Randy Smith - Not in Fridays wrote: > Ok, at a detailed ...
4 years, 7 months ago (2016-05-18 19:04:54 UTC) #16
gavinp
https://codereview.chromium.org/1977863003/diff/80001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/1977863003/diff/80001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode931 net/disk_cache/simple/simple_synchronous_entry.cc:931: bool SimpleSynchronousEntry::CheckHeaderAndKeyForOpen(int file_index) { On 2016/05/18 16:41:30, Randy Smith ...
4 years, 7 months ago (2016-05-18 19:05:03 UTC) #17
Randy Smith (Not in Mondays)
Thanks! This looks good, but I want to just get an external consult to reduce ...
4 years, 7 months ago (2016-05-18 19:42:15 UTC) #18
gavinp
On 2016/05/18 19:42:15, Randy Smith - Not in Fridays wrote: > Thanks! This looks good, ...
4 years, 7 months ago (2016-05-18 19:50:43 UTC) #19
Randy Smith (Not in Mondays)
On 2016/05/18 19:50:43, gavinp wrote: > On 2016/05/18 19:42:15, Randy Smith - Not in Fridays ...
4 years, 7 months ago (2016-05-18 20:52:52 UTC) #20
davidben
On 2016/05/18 20:52:52, Randy Smith - Not in Fridays wrote: > On 2016/05/18 19:50:43, gavinp ...
4 years, 7 months ago (2016-05-18 20:57:32 UTC) #21
Randy Smith (Not in Mondays)
On 2016/05/18 20:57:32, davidben (slow) wrote: > On 2016/05/18 20:52:52, Randy Smith - Not in ...
4 years, 7 months ago (2016-05-18 21:00:06 UTC) #22
Randy Smith (Not in Mondays)
On 2016/05/18 21:00:06, Randy Smith - Not in Fridays wrote: > On 2016/05/18 20:57:32, davidben ...
4 years, 7 months ago (2016-05-18 21:25:06 UTC) #23
Randy Smith (Not in Mondays)
On 2016/05/18 21:25:06, Randy Smith - Not in Fridays wrote: > On 2016/05/18 21:00:06, Randy ...
4 years, 7 months ago (2016-05-18 22:40:26 UTC) #24
gavinp
On 2016/05/18 20:57:32, davidben (slow) wrote: > On 2016/05/18 20:52:52, Randy Smith - Not in ...
4 years, 7 months ago (2016-05-19 12:56:06 UTC) #25
gavinp
avitkine: PTAL, new histogram. rdsmith: PTAL. This upload solves the hash collision --> bad HTTP ...
4 years, 7 months ago (2016-05-19 18:19:36 UTC) #27
Alexei Svitkine (slow)
lgtm
4 years, 7 months ago (2016-05-19 18:41:54 UTC) #28
Randy Smith (Not in Mondays)
Ok. Thanks very much for doing this; this looks fairly solid to me. LGTM with ...
4 years, 7 months ago (2016-05-19 19:38:50 UTC) #29
Randy Smith (Not in Mondays)
On 2016/05/19 19:38:50, Randy Smith - Not in Fridays wrote: > Ok. Thanks very much ...
4 years, 7 months ago (2016-05-19 19:46:46 UTC) #30
gavinp
I've addressed most of your comments. I think you're right to point out the need ...
4 years, 7 months ago (2016-05-20 01:42:32 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1977863003/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1977863003/320001
4 years, 7 months ago (2016-05-20 02:08:32 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/164993)
4 years, 7 months ago (2016-05-20 04:19:27 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1977863003/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1977863003/340001
4 years, 7 months ago (2016-05-20 11:11:59 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/225659)
4 years, 7 months ago (2016-05-20 12:03:15 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1977863003/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1977863003/380001
4 years, 7 months ago (2016-05-20 14:19:14 UTC) #44
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 7 months ago (2016-05-20 16:10:55 UTC) #46
commit-bot: I haz the power
4 years, 7 months ago (2016-05-20 16:14:03 UTC) #48
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/9f15f2258d7cae8cd12cb4ef7143ad648a958333
Cr-Commit-Position: refs/heads/master@{#395083}

Powered by Google App Engine
This is Rietveld 408576698