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

Issue 726626 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocked on:
issue 582873
issue 661979



Sign in to add a comment

preloadResponse promise resolution may take ~10 milliseconds on mobile

Project Member Reported by falken@chromium.org, May 26 2017

Issue description

In my testing it takes about 5-10 ms to resolve the preloadResponse promise on a Nexus 5, and 1-2 ms on a desktop.

Here's a somewhat silly test:
https://mattto.github.io/sw/test/nav-preload/
(click Register and then enable preload then go to event.respondWith())

Starting the worker script is intentionally delayed about 5 seconds to ensure the preloadResponse beats worker startup.

A basic promise resolution (Promise.resolve().then(...)) seems to take 0.2 to 1 ms on mobile.
 
My guess is it's because we must send one IPC to dispatch the fetch event, and then one IPC with the preloadResponse.

I don't know if it's feasible to optimize this but filing this bug.
 

Comment 1 by horo@chromium.org, Jun 1 2017

Owner: horo@chromium.org
Status: Started (was: Available)

Comment 2 by horo@chromium.org, Jun 1 2017

Blockedon: 582873
Cc: tyoshino@chromium.org yhirano@chromium.org
Components: Blink>Network>StreamsAPI
I created a CL(https://codereview.chromium.org/2915863003) to record the detailed trace, and recorded the attached trace file.

According to the trace, there are two reasons of the delay of the first execution time.
1. Creating a BodyStreamBuffer takes time. Chrome needs to compile the JS code of ReadableStream.js and CountQueuingStrategy.js.
2. Compiling the JS code of the resolver function takes time.


In the second execution time, Chrome can skip both. So the function will be executed quickly.


I think if we can cache the V8 code cache of ReadableStream.js and CountQueuingStrategy.js, we can skip 1.
And if we have the code caching for inline scripts (issue 582873) we can skip 2.
trace_navigation_preload_delay.json
267 KB View Download
navigation preload in SW.jpg
70.5 KB View Download
Cc: domenic@chromium.org
Please see https://bugs.chromium.org/p/chromium/issues/detail?id=614367 for the v8 extra performance.

Comment 4 by ricea@chromium.org, Jun 1 2017

Blockedon: 661979
And https://bugs.chromium.org/p/chromium/issues/detail?id=661979 for ReadableStream cold optimization.
Owner: ----
Status: Available (was: Started)
I don't think we plan (or can) do anything for this until the blocking bugs are fixed (and once fixed, there might not be anything to do).
Project Member

Comment 6 by sheriffbot@chromium.org, Aug 2

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Hotlist-Recharge-Cold
Status: Available (was: Untriaged)
Still no near-term fix expected.

Sign in to add a comment