| Summary: | Investigate decreasing the number of scripts loaded by requirejs in the worker at dev-time | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> | ||||
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | Silenio_Quarti, simon_kaegi | ||||
| Version: | 9.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Michael Rennie
Created attachment 254553 [details]
requirejs patched to use xhr and blob urls instead of just importScripts
This is kind of goofy and just a proof-of-concept but at least will download scripts in parallel inside of a web worker.
things to do/fix... cross-origin error handling csp check The times I'm getting for measuring the time to resolve the dependencies for ternWorkerCore are... Before: (ms) 1) 3096 2) 3094 3) 3093 After: (ms) 1) 922 2) 792 3) 885 I'm going to start the conversation with James Burke to see if he's interested in incorporating into RequireJS https://github.com/jrburke/requirejs/issues/1220 With an empty cache the times were more like 8000ms (Before) and 1500ms (after) took some timings: without patch: 2498ms 2358ms 2289ms 2357ms With patch: 447ms 424ms 424ms 452ms We should consider this in for 9.0, it really improves the first load time. Although, I would like to have a build with this in it to make sure the embedded editor is not affected. Let's get this out soon (now that Orion 9.0 is out). Do we need to address the problems mentioned in comment#2 before committing the code? I think cross-site is not an issue given workers can only load scripts on the same domain. I'm going to close this as wontfix. We have tried using the patch (which makes debugging impossible), and modifying the patch - but anything other than working with blobs has almost no effect on loading time. Since this only affects target sites, its not needed at the expense of ease of debugging. |