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

Issue 2874833005: SimpleCache: read small files all at once. (Closed)

Created:
3 years, 7 months ago by Maks Orlovich
Modified:
3 years, 3 months ago
Reviewers:
pasko, gavinp, Mark P
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

For files smaller than a configurable threshold we will only issue a single file read, immediately reading in all of metadata and stream 0 and stream 1 content upon entry opening. Files exceeding the threshold will keep the old behavior of only reading stream 0 and metadata (with somewhat more complicated sequence of file ops), and will read stream 1 content on-demand. The exact threshold will be determined by an experiment, with the code defaulting to 0 (e.g. disabled). Prefetching stream 1 content like this seem to help cold read performance significantly on Mac (and less so on Android and Linux, haven't seen much effect on Windows). Doc for experiment: https://goo.gl/RgW942 A few bits and pieces based on jkarlin's 2872943002 BUG=719979 Review-Url: https://codereview.chromium.org/2874833005 Cr-Commit-Position: refs/heads/master@{#498256} Committed: https://chromium.googlesource.com/chromium/src/+/2acfa3ba04b5902deefdc2aacdcc1d71e785d9be

Patch Set 1 #

Patch Set 2 : Actually pre-read stream1 stuff now, and wire it out of SimpleSynchronousEntry, lifting some bits f… #

Patch Set 3 : Get it to actually serve reads, c&p'ing more stuff from jkarlin's CL and some existing bits. #

Patch Set 4 : Avoid copies. This seems to work, but needs a bunch of new tests and refinement #

Patch Set 5 : Rollback overcomplicate zero copy stuff, doesn't do much. Fix copy-paste error. Rebase #

Patch Set 6 : Refactor some to reduce code dupe, though this is the easy part. #

Patch Set 7 : Refactor + range check the in-memory reads. Probably needs an another round, but a bit cleaner. #

Patch Set 8 : More refactors. #

Patch Set 9 : Remove no longer needed function split #

Patch Set 10 : Update tests. #

Patch Set 11 : Rename + comment a method. #

Total comments: 7

Patch Set 12 : Add some metrics and an experiment knob. Not really happy with coverage, though. #

Total comments: 38

Patch Set 13 : Rebase #

Patch Set 14 : Apply some of the (easier) feedback, small refactors. #

Patch Set 15 : Rename method, tweak some formatting. #

Patch Set 16 : Add tests for prefetch, apply some more feedback. #

Patch Set 17 : Remove some now-useless include additions (after moving stuff around) #

Patch Set 18 : Make DiskCacheSimplePrefetchTest.YesPrefetchNoRead run standalone. (Also remove some unwanted debug… #

Patch Set 19 : Group and array up data + crc to cut down on code dupe and excessive arg counts. #

Total comments: 43

Patch Set 20 : Apply most of review feedback, still need to deal with the struct thing #

Total comments: 6

Patch Set 21 : Apply the easy part of the feedback. #

Patch Set 22 : Add tests for CRC and footer histograms, fix bug in footer histogram reporting #

Patch Set 23 : More direct computation of file layout. Might revert based on feedback. #

Patch Set 24 : One more range check. #

Total comments: 2

Patch Set 25 : Apply review feedback. #

Total comments: 14

Patch Set 26 : Apply some of the feedback, a bit more to discuss still. #

Patch Set 27 : Apply some of the feedback, a bit more to discuss still. #

Total comments: 1

Patch Set 28 : Tweak histogram description based on feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+578 lines, -162 lines) Patch
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 18 19 20 21 10 chunks +237 lines, -26 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +19 lines, -5 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 6 chunks +59 lines, -22 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 12 13 14 15 16 17 18 19 20 21 22 6 chunks +61 lines, -17 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 16 17 18 19 20 21 22 23 24 25 12 chunks +182 lines, -92 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 17 18 19 20 21 22 23 24 25 26 27 4 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 122 (71 generated)
Maks Orlovich
Might make sense to turn this into an experiment (over the prefetch size)?
3 years, 5 months ago (2017-07-10 13:51:00 UTC) #14
pasko
A few questions for sanity checking before reviewing the code: * I saw in the ...
3 years, 5 months ago (2017-07-10 14:28:59 UTC) #15
Maks Orlovich
On 2017/07/10 14:28:59, pasko wrote: > A few questions for sanity checking before reviewing the ...
3 years, 5 months ago (2017-07-10 15:02:37 UTC) #16
pasko
OK, overall looks safe and non-invasive. How do you want to proceed? * add variable ...
3 years, 5 months ago (2017-07-11 13:24:12 UTC) #19
Maks Orlovich
On 2017/07/11 13:24:12, pasko wrote: > OK, overall looks safe and non-invasive. > > How ...
3 years, 5 months ago (2017-07-11 14:32:58 UTC) #20
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/200001/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://codereview.chromium.org/2874833005/diff/200001/net/disk_cache/simple/simple_entry_impl.cc#newcode857 net/disk_cache/simple/simple_entry_impl.cc:857: ReadInMemoryStreamData(stream_1_prefetch_data_.get(), offset, buf_len, buf, On 2017/07/11 13:24:12, pasko wrote: ...
3 years, 5 months ago (2017-07-11 14:34:07 UTC) #21
pasko
> On 2017/07/11 13:24:12, pasko wrote: > > OK, overall looks safe and non-invasive. > ...
3 years, 5 months ago (2017-07-11 16:17:31 UTC) #22
Maks Orlovich
Add some of the metrics, and an experiment knob. I am suddenly a bit worried ...
3 years, 5 months ago (2017-07-12 16:06:09 UTC) #25
pasko
Finally got to understand how the disk IO is organized. Generally looks good. On the ...
3 years, 5 months ago (2017-07-18 13:46:31 UTC) #28
pasko
a few bits on testing as well https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc File net/disk_cache/disk_cache_test_base.cc (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc#newcode95 net/disk_cache/disk_cache_test_base.cc:95: // Make ...
3 years, 5 months ago (2017-07-18 14:02:57 UTC) #29
morlovich
Commenting on stuff that needs discussing rather than just doing. https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc File net/disk_cache/disk_cache_test_base.cc (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc#newcode95 ...
3 years, 5 months ago (2017-07-18 14:32:31 UTC) #30
pasko
for the stuff worth discussing, developing the idea further https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc File net/disk_cache/disk_cache_test_base.cc (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc#newcode95 net/disk_cache/disk_cache_test_base.cc:95: ...
3 years, 5 months ago (2017-07-19 16:28:26 UTC) #31
Maks Orlovich
> go/finch101 and search for "testing-config", but you'll need to read the whole > page ...
3 years, 5 months ago (2017-07-21 14:23:42 UTC) #32
Maks Orlovich
On 2017/07/21 14:23:42, Maks Orlovich wrote: > > go/finch101 and search for "testing-config", but you'll ...
3 years, 5 months ago (2017-07-21 17:32:15 UTC) #33
Maks Orlovich
Flushing some comments, some things still in progress. https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/simple/simple_entry_impl.h File net/disk_cache/simple/simple_entry_impl.h (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/simple/simple_entry_impl.h#newcode350 net/disk_cache/simple/simple_entry_impl.h:350: bool ...
3 years, 5 months ago (2017-07-21 18:37:34 UTC) #36
pasko
On 2017/07/21 17:32:15, Maks Orlovich wrote: > On 2017/07/21 14:23:42, Maks Orlovich wrote: > > ...
3 years, 5 months ago (2017-07-24 12:04:36 UTC) #37
pasko
On 2017/07/21 14:23:42, Maks Orlovich wrote: > > go/finch101 and search for "testing-config", but you'll ...
3 years, 5 months ago (2017-07-24 12:22:31 UTC) #38
pasko
https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode1280 net/disk_cache/simple/simple_synchronous_entry.cc:1280: RecordSyncOpenPrefetchStatus(cache_type_, false); On 2017/07/21 18:37:33, Maks Orlovich wrote: > ...
3 years, 5 months ago (2017-07-24 12:22:46 UTC) #39
Maks Orlovich
> Yeah, it is not very pure, the SSEntry will need to know stream pecularities ...
3 years, 5 months ago (2017-07-25 16:06:10 UTC) #44
Maks Orlovich
Flushing a few more things https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc File net/disk_cache/disk_cache_test_base.cc (right): https://codereview.chromium.org/2874833005/diff/220001/net/disk_cache/disk_cache_test_base.cc#newcode95 net/disk_cache/disk_cache_test_base.cc:95: // Make sure to ...
3 years, 5 months ago (2017-07-25 16:06:30 UTC) #45
Maks Orlovich
Oh, the failure is due to sharding sensitivity, I think. Will fix.
3 years, 5 months ago (2017-07-25 17:46:19 UTC) #48
Maks Orlovich
PTAL --- I think I incorporated all feedback that's not the major refactor suggestion I ...
3 years, 4 months ago (2017-07-28 17:27:35 UTC) #57
pasko
Pardon for slow response, travelling/meetings/funevents/ishouldcomplainsomewhere. Overall looks correct modulo maybe one histogram is over-recorded. I ...
3 years, 4 months ago (2017-08-04 01:28:35 UTC) #60
Maks Orlovich
Flushing most of the comments. Thanks for the feedback, and don't worry about the timing ...
3 years, 4 months ago (2017-08-04 18:35:44 UTC) #64
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/simple/simple_synchronous_entry.h File net/disk_cache/simple/simple_synchronous_entry.h (right): https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/simple/simple_synchronous_entry.h#newcode85 net/disk_cache/simple/simple_synchronous_entry.h:85: struct SimpleStreamPrefetchData { On 2017/08/04 01:28:35, pasko wrote: > ...
3 years, 4 months ago (2017-08-07 13:09:02 UTC) #67
pasko
https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/entry_unittest.cc File net/disk_cache/entry_unittest.cc (right): https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/entry_unittest.cc#newcode3447 net/disk_cache/entry_unittest.cc:3447: const int kBufferSize = 50000; // to avoid quick ...
3 years, 4 months ago (2017-08-09 12:28:22 UTC) #68
Maks Orlovich
Flushing the easy stuff while look at the how to test the CRC thing. https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/simple/simple_synchronous_entry.cc ...
3 years, 4 months ago (2017-08-09 15:25:03 UTC) #69
pasko
flushing responses https://codereview.chromium.org/2874833005/diff/360001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2874833005/diff/360001/tools/metrics/histograms/histograms.xml#newcode73456 tools/metrics/histograms/histograms.xml:73456: + on first read op. On 2017/08/09 ...
3 years, 4 months ago (2017-08-09 15:33:58 UTC) #72
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/360001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode1422 net/disk_cache/simple/simple_synchronous_entry.cc:1422: SIMPLE_CACHE_UMA(BOOLEAN, "SyncCheckEOFHasCrc", cache_type_, On 2017/08/09 12:28:21, pasko wrote: > ...
3 years, 4 months ago (2017-08-09 17:52:29 UTC) #75
gavinp
Going over this, I really like storing the prefetched data explicitly in the element when ...
3 years, 4 months ago (2017-08-10 16:43:26 UTC) #76
Maks Orlovich
On 2017/08/10 16:43:26, gavinp wrote: > Going over this, I really like storing the prefetched ...
3 years, 4 months ago (2017-08-10 16:57:14 UTC) #77
Maks Orlovich
Reworked the size computation to be what I feel is more natural --- Gavin, Egor, ...
3 years, 4 months ago (2017-08-10 18:59:23 UTC) #82
gavinp
On 2017/08/10 16:57:14, Maks Orlovich wrote: > On 2017/08/10 16:43:26, gavinp wrote: > > Going ...
3 years, 4 months ago (2017-08-10 19:07:27 UTC) #86
Maks Orlovich
> Maybe let's have a short 1:1 to go through this. Sure, whenever convenient for ...
3 years, 4 months ago (2017-08-10 19:12:26 UTC) #87
pasko
On 2017/08/10 18:59:23, Maks Orlovich wrote: > Reworked the size computation to be what I ...
3 years, 4 months ago (2017-08-11 14:38:56 UTC) #88
gavinp
Maks, I've gone through it, and I think I'm OK with this, we don't need ...
3 years, 4 months ago (2017-08-15 17:45:41 UTC) #89
Maks Orlovich
On 2017/08/15 17:45:41, gavinp wrote: > Maks, > > I've gone through it, and I ...
3 years, 4 months ago (2017-08-15 17:52:19 UTC) #90
Maks Orlovich
> Thanks Gavin, I'll look forward to the review then. Sorry, but ping on this...
3 years, 4 months ago (2017-08-22 14:01:28 UTC) #91
Maks Orlovich
Would really appreciate if I could proceed with improving this...
3 years, 3 months ago (2017-08-25 16:51:17 UTC) #92
gavinp
this lgtm https://codereview.chromium.org/2874833005/diff/460001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/460001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode1362 net/disk_cache/simple/simple_synchronous_entry.cc:1362: if (!ok) { Could we just move ...
3 years, 3 months ago (2017-08-25 17:46:46 UTC) #93
Maks Orlovich
+mpearson for the histograms. https://codereview.chromium.org/2874833005/diff/460001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/460001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode1362 net/disk_cache/simple/simple_synchronous_entry.cc:1362: if (!ok) { On 2017/08/25 ...
3 years, 3 months ago (2017-08-25 18:19:54 UTC) #97
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/480001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/480001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode122 net/disk_cache/simple/simple_synchronous_entry.cc:122: "GetSimpleCachePrefetchExperiment", base::FEATURE_DISABLED_BY_DEFAULT}; Err, I should probably drop the "Get" ...
3 years, 3 months ago (2017-08-25 19:43:27 UTC) #98
Mark P
Sorry this took me a while. Somehow I missed it in my inbox, and because ...
3 years, 3 months ago (2017-08-29 04:52:30 UTC) #101
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/480001/net/disk_cache/simple/simple_synchronous_entry.cc File net/disk_cache/simple/simple_synchronous_entry.cc (right): https://codereview.chromium.org/2874833005/diff/480001/net/disk_cache/simple/simple_synchronous_entry.cc#newcode122 net/disk_cache/simple/simple_synchronous_entry.cc:122: "GetSimpleCachePrefetchExperiment", base::FEATURE_DISABLED_BY_DEFAULT}; On 2017/08/29 04:52:29, Mark P wrote: > ...
3 years, 3 months ago (2017-08-29 13:24:13 UTC) #102
Mark P
https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml#newcode75156 tools/metrics/histograms/histograms.xml:75156: + entry. On 2017/08/29 13:24:12, Maks Orlovich wrote: > ...
3 years, 3 months ago (2017-08-29 18:34:58 UTC) #111
Maks Orlovich
https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml#newcode75156 tools/metrics/histograms/histograms.xml:75156: + entry. > Enough so that people who don't ...
3 years, 3 months ago (2017-08-29 19:04:11 UTC) #112
Mark P
histograms.xml with one warning below https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2874833005/diff/480001/tools/metrics/histograms/histograms.xml#newcode75156 tools/metrics/histograms/histograms.xml:75156: + entry. On 2017/08/29 ...
3 years, 3 months ago (2017-08-29 19:13:26 UTC) #113
Maks Orlovich
On 2017/08/29 19:13:26, Mark P wrote: > histograms.xml with one warning below (If this was ...
3 years, 3 months ago (2017-08-29 19:40:38 UTC) #114
Mark P
lgtm On 2017/08/29 19:40:38, Maks Orlovich wrote: > On 2017/08/29 19:13:26, Mark P wrote: > ...
3 years, 3 months ago (2017-08-29 19:49:05 UTC) #115
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2874833005/540001
3 years, 3 months ago (2017-08-29 21:12:53 UTC) #118
commit-bot: I haz the power
3 years, 3 months ago (2017-08-29 22:25:18 UTC) #122
Message was sent while issue was closed.
Committed patchset #28 (id:540001) as
https://chromium.googlesource.com/chromium/src/+/2acfa3ba04b5902deefdc2aacdcc...

Powered by Google App Engine
This is Rietveld 408576698