-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(api-base): resolve resource promises in parallel #3
fix(api-base): resolve resource promises in parallel #3
Conversation
I ran the testsuite, so I hope this is OK, but please keep my baby JavaScript skills in mind. |
Summary: When fetching built-in resources (e.g. techlibs) for the virtual filesystem, do it in parallel by building up an array of promises and resolving them via `Promise.all`, rather than doing so sequentially. A nice effect of this is that it helps avoid HOL blocking when the resource might be non-local e.g. your in-browser HTTP request to a CDN or server suddenly starts having bad latency. It also lets us get away with less logging (ref: YoWASP#2), and removing these explicit `console.log` calls actually fixes an awkward case where `printLine` is set to a no-op function to keep things quiet, but these logs would still get output with no way to suppress it. (If this is ever brought back it should at least respect the `printLine` callback.) Fixes YoWASP#2. Signed-off-by: Austin Seipp <aseipp@pobox.com> Change-Id: Ie8085a216c22576d6956f007e2859e2381a56a12
0434b13
to
3d047fd
Compare
The package is primarily targeting the browser use case, where |
Note that once this is merged, all packages will need to (a) have the version bumped in |
Thanks! |
Thanks for the quick response! Much appreciated. |
Summary: When fetching built-in resources (e.g. techlibs) for the virtual filesystem, do it in parallel by building up an array of promises and resolving them via
Promise.all
, rather than doing so sequentially.A nice effect of this is that it helps avoid HOL blocking when the resource might be non-local e.g. your in-browser HTTP request to a CDN or server suddenly starts having bad latency.
It also lets us get away with less logging (ref: #2), and removing these explicit
console.log
calls actually fixes an awkward case whereprintLine
is set to a no-op function to keep things quiet, but these logs would still get output with no way to suppress it. (If this is ever brought back it should at least respect theprintLine
callback.)Fixes #2.
Change-Id: Ie8085a216c22576d6956f007e2859e2381a56a12