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

Issue 2922973003: RFC: use some in-memory state in SimpleCache to quickly cache-miss some CantConditionalize cases

Created:
3 years, 6 months ago by Maks Orlovich
Modified:
3 years, 4 months ago
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

Sketch permitting clients to store upto a byte of info with an entry in in-memory index of SimpleCache, and to permit using a callback to use that information to veto a hit. Use that inside HttpCache::Transaction to quickly reject cached entries with zero freshness and not enough info to refresh, when load flags don't require us to use them. (This is crude, and is missing some test changes. Also missing needed UMA changes. It would also at the very least be sensibly splittable into 2 CLs for actual review) BUG=729679

Patch Set 1 #

Patch Set 2 : Persintence, including (undertested) backwards compat... #

Patch Set 3 : Sketch actually setting oracle word (but not using it) #

Patch Set 4 : First sketch at actually using the oracle byte. Needed one more bit for prefetch thing. #

Patch Set 5 : Compile on Windows (avoid imprecise warning) #

Patch Set 6 : Fix some tests, comment out some others. #

Patch Set 7 : git cl try #

Patch Set 8 : - Implement support for oracle bytes in MockHttpCache, so the code actually gets exercised in tests… #

Total comments: 3

Patch Set 9 : Rework to the API jkarlin@ suggested. (Some of the internal naming is still messy, though) #

Patch Set 10 : cleanup naming in SimpleCache impl of this some #

Total comments: 8

Patch Set 11 : Dirty try at different approach at HttpCache::Transaction level. #

Patch Set 12 : Unbreak size + memory byte serialization, try to ubreak MSVC compile. #

Patch Set 13 : Adjust some baselines, to make sure I am aware of all actual failures.. #

Patch Set 14 : Fix test. Serialize uses the new format, of course. #

Patch Set 15 : Rebase #

Total comments: 1

Patch Set 16 : omewhat better take at higher-level HC::T impl, a bit lessy hacky, and actually write to cache now. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -50 lines) Patch
M net/base/net_error_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -0 lines 0 comments Download
M net/disk_cache/backend_unittest.cc View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M net/disk_cache/disk_cache.h View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M net/disk_cache/disk_cache.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M net/disk_cache/simple/simple_backend_version.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M net/disk_cache/simple/simple_index.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +10 lines, -2 lines 0 comments Download
M net/disk_cache/simple/simple_index.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +35 lines, -7 lines 0 comments Download
M net/disk_cache/simple/simple_index_file.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M net/disk_cache/simple/simple_index_file.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -3 lines 0 comments Download
M net/disk_cache/simple/simple_index_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +18 lines, -11 lines 0 comments Download
M net/disk_cache/simple/simple_synchronous_entry.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M net/disk_cache/simple/simple_version_upgrade.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M net/http/http_cache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +14 lines, -3 lines 0 comments Download
M net/http/http_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +9 lines, -1 line 0 comments Download
M net/http/http_cache_transaction.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -0 lines 0 comments Download
M net/http/http_cache_transaction.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +86 lines, -15 lines 0 comments Download
M net/http/http_cache_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +6 lines, -6 lines 0 comments Download
M net/http/mock_http_cache.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -0 lines 1 comment Download
M net/http/mock_http_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 78 (52 generated)
Maks Orlovich
So this is more of a request for a design review than for an actual ...
3 years, 6 months ago (2017-06-06 19:30:09 UTC) #19
Randy Smith (Not in Mondays)
On 2017/06/06 19:30:09, Maks Orlovich wrote: > So this is more of a request for ...
3 years, 6 months ago (2017-06-07 19:55:38 UTC) #22
jkarlin
Awesome that you're looking at this case. Thoughts below. https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/disk_cache.h File net/disk_cache/disk_cache.h (right): https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/disk_cache.h#newcode127 net/disk_cache/disk_cache.h:127: ...
3 years, 6 months ago (2017-06-07 20:01:54 UTC) #23
jkarlin
https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/disk_cache.h File net/disk_cache/disk_cache.h (right): https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/disk_cache.h#newcode127 net/disk_cache/disk_cache.h:127: virtual int OpenEntryWithOracleByte(const std::string& key, On 2017/06/07 20:01:54, jkarlin ...
3 years, 6 months ago (2017-06-07 20:04:45 UTC) #24
morlovich
> How about instead: > > virtual uint8_t GetMemoryEntryData(const std::string& key); > virtual void SetMemoryEntryData(const ...
3 years, 6 months ago (2017-06-07 20:28:24 UTC) #25
jkarlin
On 2017/06/07 20:28:24, morlovich wrote: > > How about instead: > > > > virtual ...
3 years, 6 months ago (2017-06-07 20:49:37 UTC) #26
jkarlin
https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/simple/simple_index.cc File net/disk_cache/simple/simple_index.cc (right): https://codereview.chromium.org/2922973003/diff/140001/net/disk_cache/simple/simple_index.cc#newcode92 net/disk_cache/simple/simple_index.cc:92: return entry_size_ & 0xFFFFFF00; I'd rather add a byte ...
3 years, 6 months ago (2017-06-08 14:44:07 UTC) #27
Maks Orlovich
On 2017/06/07 20:49:37, jkarlin wrote: > Yet another reason for having the key in the ...
3 years, 6 months ago (2017-06-09 14:49:24 UTC) #28
jkarlin
On 2017/06/09 14:49:24, Maks Orlovich wrote: > On 2017/06/07 20:49:37, jkarlin wrote: > > Yet ...
3 years, 6 months ago (2017-06-09 15:34:26 UTC) #29
Randy Smith (Not in Mondays)
On 2017/06/09 14:49:24, Maks Orlovich wrote: > On 2017/06/07 20:49:37, jkarlin wrote: > > Yet ...
3 years, 6 months ago (2017-06-09 17:37:15 UTC) #30
jkarlin
> I'm a bit concerned about the implication that there's only one consumer of the ...
3 years, 6 months ago (2017-06-09 18:03:35 UTC) #31
Randy Smith (Not in Mondays)
On 2017/06/09 18:03:35, jkarlin wrote: > > I'm a bit concerned about the implication that ...
3 years, 6 months ago (2017-06-09 18:07:11 UTC) #32
Maks Orlovich
Hmm, a different concern: looking through higher-level failures, one is: IN_PROC_BROWSER_TEST_F(ErrorPageTest, StaleCacheStatus) { Which points ...
3 years, 6 months ago (2017-06-12 14:29:51 UTC) #34
Randy Smith (Not in Mondays)
On 2017/06/12 14:29:51, Maks Orlovich wrote: > Hmm, a different concern: looking through higher-level failures, ...
3 years, 6 months ago (2017-06-12 15:15:42 UTC) #35
pasko
(back from vacation) the high level design looks reasonable, and I'm excited about the potential ...
3 years, 6 months ago (2017-06-13 14:30:05 UTC) #42
Maks Orlovich
> I'm raising an abstract Truth&Beauty concern as I'm not sure there are other > ...
3 years, 6 months ago (2017-06-13 14:55:29 UTC) #43
Maks Orlovich
Might be different enough to be worth another look; I am thinking maybe splitting off ...
3 years, 6 months ago (2017-06-13 14:58:48 UTC) #44
Randy Smith (Not in Mondays)
I like the disk cache interface as written. I'm inclined to defer to others on ...
3 years, 6 months ago (2017-06-13 17:52:21 UTC) #45
Maks Orlovich
(Will also reply to the main conversation there separately.. doesn't seem like I can do ...
3 years, 6 months ago (2017-06-13 18:15:08 UTC) #46
Maks Orlovich
On 2017/06/13 17:52:21, Randy Smith (Not in Mondays) wrote: > I like the disk cache ...
3 years, 6 months ago (2017-06-13 18:25:21 UTC) #47
Maks Orlovich
https://codereview.chromium.org/2922973003/diff/280001/net/http/http_cache_transaction.cc File net/http/http_cache_transaction.cc (right): https://codereview.chromium.org/2922973003/diff/280001/net/http/http_cache_transaction.cc#newcode2560 net/http/http_cache_transaction.cc:2560: next_state_ = STATE_SEND_REQUEST; So I just realized that this ...
3 years, 6 months ago (2017-06-14 19:59:30 UTC) #69
Randy Smith (Not in Mondays)
On 2017/06/13 18:25:21, Maks Orlovich wrote: > On 2017/06/13 17:52:21, Randy Smith (Not in Mondays) ...
3 years, 6 months ago (2017-06-15 17:14:27 UTC) #74
gavinp
Generally looks good to me; previous comments captured most of what I think. I imagine ...
3 years, 5 months ago (2017-06-26 20:18:11 UTC) #75
pasko
On 2017/06/26 20:18:11, gavinp OOO until May wrote: > Generally looks good to me; previous ...
3 years, 5 months ago (2017-06-27 09:53:51 UTC) #76
gavinp
@morlovich: What's happening with this issue? I've seen two CLs from here already, and I ...
3 years, 4 months ago (2017-08-04 18:52:34 UTC) #77
Maks Orlovich
3 years, 4 months ago (2017-08-04 18:56:46 UTC) #78
On 2017/08/04 18:52:34, gavinp wrote:
> @morlovich: What's happening with this issue? I've seen two CLs from here
> already, and I guess there's one or two more to go?
> 
> Is there anything to do advancing this sketch, or is it done now? Let me know
if
> I can contribute anything.

This one is just the proof of concept for the two pieces you individually
reviewed, plus a not-yet-created future CL to actually use that infrastructure 
in HttpCache::Transaction. A full review of this would likely be a waste of time
(since large parts are cruder versions of what you already reviewed), but 
there may opportunities to save me from future pain in looking at the
http_cache* changes only.

Powered by Google App Engine
This is Rietveld 408576698