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.
,
Jun 26 2018
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
,
Jun 26 2018
Would you mind filing an issue in the HTML spec repository? https://github.com/whatwg/html/issues
,
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.
,
Jun 26 2018
,
Jun 27 2018
As per comment #2, the issue seems to be a feature request. Hence, marking it as untriaged for further inputs from dev team. Thanks...!!
,
Jun 29 2018
Changing status to ExternalDependency as this seems to need a spec discussion.
,
Jun 29 2018
Removing all milestone labels because this is WAI for now and there're no items for a specific milestone.
,
Sep 3
Spec issue: https://github.com/whatwg/html/issues/3775 domenic@ is changing the spec: https://github.com/whatwg/html/pull/3827 |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by kojii@chromium.org
, Jun 26 2018