New issue
Advanced search Search tips

Issue 856488 link

Starred by 1 user

Issue metadata

Status: ExternalDependency
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

importScripts in webworker does not download in parallel

Reported by nilesh...@gmail.com, Jun 26 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

Steps to reproduce the problem:
1. create a new Worker with importScripts("a.js", "b.js")
2. Observe that a.js is downloaded and executed before b.js can be downloaded or executed

What is the expected behavior?
a.js and b.js should be downloaded in parallel, and executed synchronously

What went wrong?
Both download and execution are done synchronously

Did this work before? No 

Chrome version: 67.0.3396.87  Channel: stable
OS Version: 10.0
Flash Version: 

Neither Edge or Firefox seem to do this today, looking at spec it only stipulates that execution must occur synchronously. I have spoken with the Edge team and they seem to be of the opinion that the downloads can be done in parallel to improve performance.

Is there some reason all browser vendors seem to have agreed to make these synchronous? If not, I will investigate and try and do this change myself.
 

Comment 1 by kojii@chromium.org, Jun 26 2018

Components: -Blink Blink>Workers
Labels: -Type-Bug Type-Feature
I agree this may improve performance, but this seems to need spec changes.

The current HTML spec requires all script fetch and execution sequentially happen. In other words, "in parallel"[1] is not specified on the for-each loop on the importscripts() algorithm:

  // https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts
  For each url in the resulting URL records, run these substeps:
    1. Fetch a classic worker-imported script given url and settings object, passing along any custom perform the fetch steps provided. If this succeeds, let script be the result. Otherwise, rethrow the exception.
    2. Run the classic script script, with the rethrow errors argument set to true.

[1] https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel
Would you mind filing an issue in the HTML spec repository?
https://github.com/whatwg/html/issues

Comment 4 by nilesh...@gmail.com, Jun 26 2018

It seems the spec changed and got much more specific now that module workers are coming out, I can file an issue against the HTML spec repository and then circle back here. 
Labels: Needs-Triage-M67
Labels: Triaged-ET M-69 Target-69 FoundIn-69
Status: Untriaged (was: Unconfirmed)
As per comment #2, the issue seems to be a feature request. Hence, marking it as untriaged for further inputs from dev team.

Thanks...!!

Comment 7 by bashi@chromium.org, Jun 29 2018

Labels: -Pri-2 -M-69 -Target-69 Pri-3
Status: ExternalDependency (was: Untriaged)
Changing status to ExternalDependency as this seems to need a spec discussion.
Labels: -Arch-x86_64 -Triaged-ET -FoundIn-69 -Needs-Triage-M67 OS-Android OS-Chrome OS-Linux OS-Mac
Removing all milestone labels because this is WAI for now and there're no items for a specific milestone.

Sign in to add a comment