preloadResponse promise resolution may take ~10 milliseconds on mobile |
|||||||
Issue descriptionIn 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.
,
Jun 1 2017
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.
,
Jun 1 2017
Please see https://bugs.chromium.org/p/chromium/issues/detail?id=614367 for the v8 extra performance.
,
Jun 1 2017
And https://bugs.chromium.org/p/chromium/issues/detail?id=661979 for ReadableStream cold optimization.
,
Aug 2 2017
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).
,
Aug 2
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
,
Aug 3
Still no near-term fix expected. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by horo@chromium.org
, Jun 1 2017Status: Started (was: Available)