New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 841039 link

Starred by 4 users

Issue metadata

Status: Duplicate
Merged: issue 876836
Owner: ----
Closed: Aug 27
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 598073



Sign in to add a comment

Implement V8 code caching with network service

Project Member Reported by jam@chromium.org, May 8 2018

Issue description

Pavel pointed out that V8 code caching, implemented in 399580, doesn't work with network service. The DidGenerateCacheableMetadata/DidGenerateCacheableMetadataInCacheStorage calls in RenderMessageFilter assume the network cache is running in the browser, which is not the case with network service.

This bug tracks getting this feature working.

V8 team: can you please add integration tests for this?
 
Cc: johannes@chromium.org
Sorry for the ignorance. What is the network service?

It is true that the code cache relies on the JS source to be already cached by the http cache. The code cache data is stored there as cache metadata.
Cc: leszeks@chromium.org mythria@chromium.org
Drive-by comments:

#2: The network service implements network-related functionality in its own mojo process. It's a major, ongoing refactoring of Chromium's networking functionality. It isn't (and can't be) fully API compatible with the previous, non-mojo-ified code, so this requires work on many neighbouring code bits.

#0: networking and RenderMessageFilter are several layers away from what V8 team is working on. (V8 --> Blink/V8 bindings --> blink::Resource --> ... [Here I get lost myself]) I suspect they're not the right people to address this.

#4: It turns out, I think I'm not the right person to address this either, since these days I'm not working on any of the involved pieces.


Writing a proper integration test is a good idea, but back when I looked at this I didn't find a palatable way of doing that. It would be useful if the senior engs on this issue could outline a good way of testing this.

We have one test for service-workers [1] that checks that we have both produced and consumed the code. If I understand correctly, the service-workers caching would go through DidGenerateCacheableMetadataInCacheStorage. So, if that test is working with network service then I thought normal caches would work as well.

leszeks@ tried adding a similar test (using devtools) for the normal caches but could not get it to working. We could not think of any other alternatives. 

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache.js?dr
Cc: morlovich@chromium.org
I am pretty sure DidGenerateCacheableMetadataInCacheStorage shouldn't have been listed in the original report, and as a flipside, it working doesn't mean DidGenerateCacheableMetadata would.  Basically CacheStorage has its own directories for stuff, that are completely distinct from what HttpCache uses (they are not even format compatible on the platforms where they use the same disk_cache backend, IIRC); so Network Service owning the HTTP cache doesn't change anything for that.

DidGenerateCacheableMetadata does of course need to be changed. (And this may have a lot of overlap with the double-keying work, also when it comes to deciding how it's designed wrt to whether the browser process is involved or not, etc.)


 Issue 841526  has been merged into this issue.
Labels: Proj-Servicification-Canary
I just stumbled on this bug.  V8 Code Cache has been crucial to service worker performance. It seems important to fix this, if it's not fixed already.
I think this does not impact the service worker cache. They are not owned by the network service if I understand correctly. This is only for the code currently stored in the HttpCache.

Comment 10 by dxie@chromium.org, Jun 5 2018

Labels: Proj-Servicification
Cc: rmcilroy@chromium.org
With the new design of the code caches that are decoupled from the HttpCache, I am not sure this would be needed. The new metadata caches will be owned by the browser and not by network service. Though the decoupled code caches would take at least a couple of quarters to be enabled by default. We may have to fix this if network service is enabled before that time.


Cc: horo@chromium.org
+horo@ for the failure on service worker tests. I am not sure the v8 code caches and service worker caches are the same issue though. See c#6.

Comment 14 by dxie@google.com, Jun 26 2018

Labels: -Proj-Servicification-Canary
#12- depending on expected perf regression & how long the new code could take we might some migration there, though that can probably be decided after we start to get more perf data...

And yes the service worker one should be fine, and mythria's new design should solve this for regular loading too eventually.

Mergedinto: 876836
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment