There exists a limit on the size of a module that can be compiled with `new WebAssembly.Module()` on the main thread. This limit is 4KB, and it was introduced when WebAssembly modules got compiled eagerly with an optimizing compiler, which could block the main thread for many seconds and even minutes. In the meantime V8 launched lazy compilation for WebAssembly modules, and the execution time of `new WebAssembly.Module()` is below 1 second even for the biggest modules we see, even on the weakest devices we measured. Therefore it is time to remove this limit.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Shipping on desktop | 114 |
Shipping on Android | 114 |
Shipping on WebView | 114 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
NoneAndreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
LGTM1
This doesn't show up in our chromestatus UI. Have you sent if for
"shipping" there? If no further comments arrive, it may be that it
has fallen off our radar because of that.
/Daniel
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTve0zdDNeCDXvG%3D73-zVy8Fps_9eFErWfOocSfxbzOxGHQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTve0zdDNeCDXvG%3D73-zVy8Fps_9eFErWfOocSfxbzOxGHQ%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTve0zdDNeCDXvG%3D73-zVy8Fps_9eFErWfOocSfxbzOxGHQ%40mail.gmail.com.
--Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvfdj1exWfsUYs4RjbSc7WOTTpNyb1aXCA0R3uPQzCci6w%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvfdj1exWfsUYs4RjbSc7WOTTpNyb1aXCA0R3uPQzCci6w%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvfdj1exWfsUYs4RjbSc7WOTTpNyb1aXCA0R3uPQzCci6w%40mail.gmail.com.
--Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvc6QoyFWYAhsCh9eSvOvpu0JpgEPSn2UuKLZRNOKsyAGg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Hey Andreas,
Thank you for collecting that data! Making a decision based on evidence is much easier and less contentious. The Nokia 1 is a classic "all-slow-A53-cores, all the time" device on that terrible 28nm process that is (finally!) leaving the ecosystem. Devices with that profile are likely leaving service, and the Pixel and Pixel 2 are more evocative of where the low-end is likely to be today and in the near future, so I'm comfortable anchoring on that.This raises some questions about your data, particularly the jumps up and down in the first six rows. Do you have an intuition for why the 35K module was so much more costly than those around which are nominally larger? Did it exercise different features or tickle different compilation paths? Should that sort of variance be taken into consideration here?
Your post also raises a set of points that have a history which I'm going to try to avoid fully recounting here. As I no longer serve as Standards TL for Chrome, you might consult with Chris and Jeff (cc'd) regarding the project's overall orientation towards letter vs. spirit of the law when it comes to standards making and our priority of constituencies in browser making and standards setting. Suffice to say, we have inherent leeway to go our own way when standards are a hazard to users, and the Blink Launch Process has been carefully designed and tended to maintain that flexibility.I will, however, dig into a specific point from the initial design discussions which involved debate between the W3C TAG (on which I served at the time), the WASM WG, and the then-serving API OWNERS.In the initial design, the current spec language around synchronous compilation existed in roughly it's current form, and this was caught rather late as a sub-point of larger concerns about platform integration that the WASM WG had (generously) overlooked; things like CSP controls, etc. It was confidently asserted by some at the time that "nobody will ship synchronous compilation to their users", but when prodded by Elliott (cc'd), myself, and others, it turned out that this was exactly what the popular toolchains of the day were doing.Blink took the position, based on the devices and networks that we serve the majority of our users on, that this was not a responsible approach and would lead to large regressions, akin to much of the badness that the V8 team has spent huge resources to mitigate with main-thread JS compilation (background). The explicit calculus with the 4K limit was based on a market reality that, if no other engine were to be responsible, but Chromium would, that we would still generate the intended positive effect in the ecosystem. All of the points you've raised about developer needs and benefits were litigated at the time, and found wanting based on the project's overall goals.It is, of course, frustrating that the WASM WG (including our participants there) have not seen fit to update the spec with more realistic guidance for browser embedders, but suffice to say, Chromium's approach has worked. The net effect of a fully unbounded proposal in this intent would be to create a predictable free-fire zone on main thread blocking, which is something that dozens of your colleagues have spent hundreds of person-years to reduce.Obviously, we aren't still discussing a fully unbound proposal any more (thank you!), but as we look to set a new limit, it will be helpful to know more details about where we can make tradeoffs that help developers without harming the user experience of the web. For example, do you (or other folks here) have an intuition (or data) about the needs of JITs? Will memory regions need to be self-contained WASM modules to enable reasonable behaviour? Or is chunking into more (smaller) modules acceptable in some situations?
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
There seems to be a lot of different things being discussed here:
(1) The limit seems too low for newer hardware or engine architectures.
(2) In some scenarios during development it would be nice to have synchronous compiles.
(3) The spec doesn't say anything about sync compile limits.
(4) There's an expectation (from some) that developers will "do the right thing" for performance.
(5) We should remove the limit entirely.
For (1), and from looking at the table, it seems like maybe ~25k is a more modern limit? That seems fine to me. Why is 35k slower than 250k though?
For (2) Alex is correct that the right "escape hatch" around best practices for development is runtime flags. There's many examples of this in the web platform, for example the ability to use invalid certs for localhost. It's also repeated multiple times in this thread that production code should be using async compiles, and that tooling usually generates that too. You also state that development should match production (which I agree with), so then development should also be async?
For (3) that sounds like a spec problem. The spec should be adjusted to allow the existence of implementation defined limits.
For (4) I think it's objectively false. Not just within performance, but engineering in general (see ex. Rust for safety by default :)). As someone who represents thousands of engineers building web apps I can tell you that it's incredibly hard to get performance right, and every time the platform imposes constraints to keep folks from shooting their feet off the outcomes at scale are better.
For (5) I think it would be a mistake to remove the limit entirely. I was very involved in adding this limit originally, and it came from looking at traces across many websites and working with many companies for years trying to make their web apps fast. We also noticed that early on folks using WASM were trying to compile larger and larger files on the main thread. That we avoided the mistakes of JS code loading for WASM should be viewed as a victory for the platform, not a wart.
A rough analogy would be to think about this from the angle of disk IO on the main thread. It would both make development/testing easier, and probably be fast some of the time, ex. ~3ms for readFileSync of .gitconfig on my Macbook. Even so, the web doesn't allow sync file IO from the main thread because the risks outweigh the DX improvements.
Hi Elliott,On Thu, Apr 27, 2023 at 11:01 PM Elliott Sprehn <esp...@chromium.org> wrote:There seems to be a lot of different things being discussed here:
(1) The limit seems too low for newer hardware or engine architectures.
(2) In some scenarios during development it would be nice to have synchronous compiles.
(3) The spec doesn't say anything about sync compile limits.
(4) There's an expectation (from some) that developers will "do the right thing" for performance.
(5) We should remove the limit entirely.
For (1), and from looking at the table, it seems like maybe ~25k is a more modern limit? That seems fine to me. Why is 35k slower than 250k though?The difference is the number of imported functions declared in the wasm module. We have plans to improve the handling of imported functions, but in our metrics the absolute time spent on the handling of imported functions was always quite small, so other optimizations had priority so far.For (2) Alex is correct that the right "escape hatch" around best practices for development is runtime flags. There's many examples of this in the web platform, for example the ability to use invalid certs for localhost. It's also repeated multiple times in this thread that production code should be using async compiles, and that tooling usually generates that too. You also state that development should match production (which I agree with), so then development should also be async?There are not only end-to-end tests where the testing environment should be as close to production as possible, but there are also other kinds of tests, like unit tests. After writing the async test runner for the core wasm spec tests I can tell you that it can be a huge pain to write async tests.For (3) that sounds like a spec problem. The spec should be adjusted to allow the existence of implementation defined limits.As stated before: we are currently violating the spec. In Chrome/V8, we should implement the spec, not our personal opinions.
If you think that the spec should be changed, please direct your arguments at the public Wasm community (github.com/WebAssembly/spec/issues).
If the spec is changed to include a limit for sync compilation, then this limit will naturally be implemented in V8/Blink. Until then, we should be spec-compliant by not having a limit.
Cheers, Andreas
Hi Alex,
TAG review statusNot applicable
Risks
Interoperability and Compatibility
Gecko: Shipped/Shipping
WebKit: Shipped/Shipping
Web developers: Strongly positive We received repeated bug reports because of this limit. Especially for tests synchronous compilation with `new WebAssembly.Module()` is useful, but the size limit prevents bigger tests from using synchronous compilation.
Other signals:
WebView application risksDoes this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Debuggability
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?Yes
Is this feature fully tested by web-platform-tests?No
Is it interoperably tested by other means? I'm not super familiar with WASM testing..
Flag name
Requires code in //chrome?False
Estimated milestonesShipping on desktop114Shipping on Android114Shipping on WebView114
Anticipated spec changesOpen questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
None
Link to entry on the Chrome Platform Statushttps://chromestatus.com/feature/5080569152536576
Links to previous Intent discussionsThis intent message was generated by Chrome Platform Status.--Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTvcq5b4gz6U3SYBjPkU1jCZtaPnNZr9tDsD8fZxG7w8Hvg%40mail.gmail.com.
----Andreas Haas
Software Engineer
Google Germany GmbH
Erika-Mann-Straße 33
80636 München
Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.
This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Hi,sorry that I misunderstood the process.
I guess I understand that you will not agree to remove this limit entirely. I don't understand your reasons for that, or the concrete scenarios that we try to avoid, but I can accept that.
For the issues we received bug reports about I guess a higher limit will be sufficient.I would propose a limit of 8MB. My reasoning behind that limit is the following:The maximum function size according to the spec is 7,654,321 bytes [1], so just below 8MB. A module with 1 function plus metadata should therefore most likely be below 8MB. The JIT compiler would therefore not be blocked by this limit if they generate functions one by one.According to the measurements the 8MB should also be mostly fine. If we take the Pixel 1 as the baseline then compiling an 8MB module should take around 200ms, which is the CWV INP threshold.So, would a limit of 8MB be acceptable for you?
Hi Yoav,I know that the API owners have much more experience than me when it comes to web APIs, and what kind of code gets shipped on the web. So when you think that some limit for synchronous WebAssembly compilation is warranted, then I believe you and accept it.What is not clear to me yet if you are aware of the magnitudes we are talking about here.The huge modules I measured contain around 200'000 functions, the newer modules a bit less because of inlining. The 80MB module was the main module for Photoshop, so that's already a really big application. Also, it's a quite old legacy application, so I guess there is also quite some dead code in this module. As it turns out, such a big module has many downsides, from loading time to debugging and so on, so there are plans to support splitting such modules into smaller modules to make the handling easier. So my intuition is that modules will not get significantly bigger than 80MB. Are you worried that modules could get much bigger than 80MB and 200'000 functions, and that's why you think a limit is warranted?
Or do you have a world in mind where developers load many external libraries, and that the loading of these external libraries will cause too much blocking of the main thread? If libraries are loaded, how big would such libraries typically be? I mean, a 8MB module would probably also contain around 20'000 functions, which seems quite a lot to me. How many libraries with 20'000 functions each are to be expected?
When I did my measurements I thought I showed them that even modules which anyway get compiled with streaming compilation can get compiled reasonably fast with synchronous compilation. I do not assume that any meaningful webpage will ever compile such big modules synchronously, simply because with the currently existing tools it is hard to accumulate such an amount of code and use synchronous compilation. As far as I understand, you do seem to assume that if unlimited synchronous compilation exists, then it will also be used for the biggest modules. Is that true? Do you make this assumption just to be on the safe side, or do you have other reasons.
One more question: Assuming there would not be a limit, and the main thread does get blocked by synchronous compilation. Does any single jank matter, no matter when it happens, or is it repeated janks that should be avoided? My assumption was that having one jank during startup would not matter so much, and that avoiding repeated janks later during the app execution would matter more. Especially since other steps during startup like downloading the wasm module would take much longer.
I guess these are a lot of questions now, but I would like to understand your thought process better for future projects.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfXKZ0%2BtNXpgN7w_r%2BjOz3TDRhuwm7dAHXwzJ5-q19AxNw%40mail.gmail.com.
On 5/4/23 6:40 AM, 'Andreas Haas' via blink-dev wrote:
Hi Yoav, PhistucK,
I think I realized now where some of the confusion and misunderstanding came from:
My goal was to remove the limit because it's a spec violation, and I don't see a justification to keep the limit. There are some use cases like testing and user-space JIT compilers, but in both cases a higher limit is sufficient.
So, to become spec compliant for me the default was to implement the current spec and to remove the limit unless there is a reason to keep it.
I guess for the API owners it's the other way around, removing the limit may allow unwanted behavior, so for you the default would be to keep the limit, unless there is a use case to remove the limit.
In a practical sense there may not be a difference between a limit of 8MB and not having a limit at all.
My problem now is that with the higher limit we still violate the spec, an with the spec test I introduced during this discussion the spec violation is even more visible. As someone wrote before, a solution to this problem could be to change the spec, but the same as there is no reason to keep or remove the limit in Chrome, there is no reason to introduce such a limit into the spec.
This has already been noted elsewhere, but I'll try to reinforce. It's entirely OK for us to make choices on behalf of our users, even if a spec says otherwise. Specs change all the time (and frequently have bugs in them). My POV here wouldn't be that we're violating the spec, but that the spec allows for a potentially harmful user experience. At the very least, there's a reasonable argument to be made that the limit should be implementation defined, if other engines have different thresholds on blocking the main thread. And maybe an informative note explaining what the consequences of having no limits might be.
Another path is to attempt to spec the 8MB limit, and perhaps it
can be made larger in the future - acknowledging that convincing
the other engines to agree requires non-zero effort.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAELSTveczYiFcfcu%3DP%2B1qAbyomc_V4hZ8w-L1mRVRP3jMC%2BDXg%40mail.gmail.com.
My problem now is that with the higher limit we still violate the spec, an with the spec test I introduced during this discussion the spec violation is even more visible. As someone wrote before, a solution to this problem could be to change the spec, but the same as there is no reason to keep or remove the limit in Chrome, there is no reason to introduce such a limit into the spec.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPKeNH%3DnkK6o8mZUHazY-QU6jH8O4Yw9UNqt8sb%2B8PCLaCfU%2Bg%40mail.gmail.com.