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

Issue 2411243004: [WeakMemoryCache] Remove LRU lists, prune order control and live/dead distinction (Closed)

Created:
4 years, 2 months ago by hiroshige
Modified:
4 years, 1 month ago
CC:
Aaron Boodman, abarth-chromium, darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-api_chromium.org, blink-reviews-css, blink-reviews-style_chromium.org, chromium-reviews, darin (slow to review), dglazkov+blink, gavinp+loader_chromium.org, Nate Chapin, kinuko+watch, loading-reviews+fetch_chromium.org, qsr+mojo_chromium.org, rwlbuis, tyoshino+watch_chromium.org, viettrungluu+watch_chromium.org, Yoav Weiss, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[WeakMemoryCache] Remove LRU lists, prune order control and live/dead distinction This CL removes most of the control mechanisms for prune ordering of Resources (except one using |m_lastDecodedAccessTime|), including those using the LRU order, |m_lastDecodedAccessTime|, |m_maxDeferredPruneDeadCapacity|, and |m_accessCount|. This enable us to: - Remove updateDecodedResource(), updateForAccess() and thus didAccessDecodedData(). - Make update() to do nothing except for |m_size| update. - Remove |m_liveDecodedResources| and |m_allResources| and make Resources managed only by the simple hashmaps in |m_resourceMaps|. - Remove live/dead distinction in MemoryCache. - Remove min/max dead capacities. - Merge liveSize() and deadSize() into size(). Removal of min/max dead capacities and live/dead distinction causes more code outside core/fetch to be unused. https://codereview.chromium.org/2435603002/ will remove such unused code. This CL also - Removes a prune() call in didAccessDecodedData(). - Adds |const| to some methods. This CL increases web_cache size reported in memory-infra (e.g. memory.top_10_mobile performance test's web_cache:effective_size_avg), but this doesn't affect the real memory usage. Previously, dead Resources were evicted during pruneDeadResources() and such Resources were not reported to memory-infra. This CL make such Resources to be reported to memory-infra because this CL doesn't evict Resources during pruneResources(). BUG=603462 Committed: https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514 Cr-Commit-Position: refs/heads/master@{#432972}

Patch Set 1 #

Patch Set 2 : git cl try #

Patch Set 3 : temp #

Patch Set 4 : fix #

Patch Set 5 : cleanup #

Patch Set 6 : fix crash #

Patch Set 7 : Fix update bug #

Patch Set 8 : Rebase #

Total comments: 4

Patch Set 9 : Rebase, rename MemoryCache::setCapacities() #

Total comments: 8

Patch Set 10 : reflect yhirano comments #

Total comments: 4

Patch Set 11 : yhirano's comment about tests #

Patch Set 12 : Fix #

Total comments: 2

Patch Set 13 : Rebase2 #

Patch Set 14 : Rebase after toyoshim's change #

Patch Set 15 : Reflect yhirano's comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -827 lines) Patch
M third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -67 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -9 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCache.h View 1 2 3 4 5 6 7 8 10 chunks +31 lines, -146 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCache.cpp View 1 2 3 4 5 6 7 8 9 13 12 chunks +96 lines, -417 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +83 lines, -166 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +0 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebCache.cpp View 1 2 3 4 5 6 7 8 2 chunks +10 lines, -11 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 69 (53 generated)
hiroshige
PTAL.
4 years, 2 months ago (2016-10-21 07:04:48 UTC) #26
Nate Chapin
:D !!! https://codereview.chromium.org/2411243004/diff/140001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2411243004/diff/140001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode483 third_party/WebKit/Source/core/fetch/ImageResource.cpp:483: void ImageResource::didDraw(const blink::Image* image) { Looks like ...
4 years, 2 months ago (2016-10-21 18:48:20 UTC) #27
yhirano
https://codereview.chromium.org/2411243004/diff/160001/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp File third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp (right): https://codereview.chromium.org/2411243004/diff/160001/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp#newcode63 third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp:63: TEST_F(CSSStyleSheetResourceTest, PruneCanCauseEviction) { According to https://codereview.chromium.org/1537343002 this test is ...
4 years, 1 month ago (2016-10-24 08:14:00 UTC) #32
hiroshige
https://codereview.chromium.org/2411243004/diff/140001/third_party/WebKit/Source/core/fetch/ImageResource.cpp File third_party/WebKit/Source/core/fetch/ImageResource.cpp (left): https://codereview.chromium.org/2411243004/diff/140001/third_party/WebKit/Source/core/fetch/ImageResource.cpp#oldcode483 third_party/WebKit/Source/core/fetch/ImageResource.cpp:483: void ImageResource::didDraw(const blink::Image* image) { On 2016/10/21 18:48:20, Nate ...
4 years, 1 month ago (2016-10-24 10:35:28 UTC) #33
hiroshige
https://codereview.chromium.org/2411243004/diff/160001/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp File third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp (right): https://codereview.chromium.org/2411243004/diff/160001/third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp#newcode63 third_party/WebKit/Source/core/css/CSSStyleSheetResourceTest.cpp:63: TEST_F(CSSStyleSheetResourceTest, PruneCanCauseEviction) { On 2016/10/24 08:14:00, yhirano wrote: > ...
4 years, 1 month ago (2016-10-24 10:48:25 UTC) #35
yhirano
https://codereview.chromium.org/2411243004/diff/180001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp File third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp (right): https://codereview.chromium.org/2411243004/diff/180001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp#newcode149 third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp:149: // Next task: now, the live resource was evicted. ...
4 years, 1 month ago (2016-10-26 09:47:51 UTC) #39
hiroshige
https://codereview.chromium.org/2411243004/diff/180001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp File third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp (right): https://codereview.chromium.org/2411243004/diff/180001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp#newcode149 third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp:149: // Next task: now, the live resource was evicted. ...
4 years, 1 month ago (2016-11-04 07:50:59 UTC) #42
yhirano
Sorry for the long delay. LGTM. https://codereview.chromium.org/2411243004/diff/220001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp File third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp (right): https://codereview.chromium.org/2411243004/diff/220001/third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp#newcode153 third_party/WebKit/Source/core/fetch/MemoryCacheTest.cpp:153: static void TestResourcePruningAtEndOfTask(Resource* ...
4 years, 1 month ago (2016-11-14 05:59:55 UTC) #45
hiroshige
+mkwst@, could you take a look, especially at core/css and web/ changes as a core/ ...
4 years, 1 month ago (2016-11-16 09:27:50 UTC) #49
Mike West
LGTM. Thanks! You mention `web_cache:effective_size_avg` as being not _actually_ affected: are there any metrics you ...
4 years, 1 month ago (2016-11-17 14:32:40 UTC) #54
hiroshige
On 2016/11/17 14:32:40, Mike West wrote: > LGTM. Thanks! > > You mention `web_cache:effective_size_avg` as ...
4 years, 1 month ago (2016-11-17 15:47:06 UTC) #57
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/2411243004/320001
4 years, 1 month ago (2016-11-17 15:56:25 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/264303)
4 years, 1 month ago (2016-11-17 17:30:17 UTC) #63
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/2411243004/320001
4 years, 1 month ago (2016-11-17 17:53:45 UTC) #65
commit-bot: I haz the power
Committed patchset #15 (id:320001)
4 years, 1 month ago (2016-11-17 21:43:56 UTC) #67
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 21:48:48 UTC) #69
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/a756f82e21bd1af1025d373c099c8a7e7b589514
Cr-Commit-Position: refs/heads/master@{#432972}

Powered by Google App Engine
This is Rietveld 408576698