-
Notifications
You must be signed in to change notification settings - Fork 45
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
[discussion] deterministic execution in turns #85
Comments
Indeed. We had to figure this out for HTML Imports. In realistic network condition, waiting until everything loads is unlikely to result acceptable performance characteristics. |
For modules I don't think we have a choice. You simply cannot execute a module before its dependencies have been executed. So you cannot execute any part of the module tree before all its children have been executed. |
@domenic this discussion is not really about the "imported" module, it is about parts of the dependency tree that can be executed in turns. E.g.: while doing import A: A -> B -> C, while B -> D and C -> E If B and D are in "link" stage, and the pipeline is just waiting for C, and E to be fetched, we could, theoretically, evaluate B and C, get them to "ready" stage, without any observable difference in the runtime while maintaining the deterministic aspect of the module graph since this is equivalent to: import B, then import A; Today, this is not the case since we need to get every module in the graph in link stage before proceeding to the evaluation phase. Note: |
Ah, I see. The execution model for whatwg/html#443 does not have that problem; it executes everything as soon as its dependencies are ready. |
that is correct! |
It's a bit more complicated than my above comment implied sadly. See whatwg/html#443 (comment). Basically my above comment is correct about the current whatwg/html#443 PR, but that state of affairs is actually due to a bug that gives us semantics that are something like "defer except execution order is not preserved". If you preserve execution order (per normal defer semantics) than you get a problem similar to the one described in this bug where large/slow trees that are earlier in the source order can block small/fast trees later in the source order. If you want the kind of incremental as-soon-as-it-loads tree execution style then you want something more like async. Anyway, more discussion over there, I just wanted to update this thread since my above comment was incorrect. |
I don't think this is related to whatwg/html#443. We will be able to introduce execution in turn for any dependency of a top level module imported via script tags without changing the way you interact with the loader (from what I can read in whatwg/html#443). It is really all about the loader, and when it invokes evaluation in certain module records. |
notes:
await
should be taken into consideration.The text was updated successfully, but these errors were encountered: