3 ms·
Not in this case, I'm preloading the wasm binary blob and then assigning it to the Module object. With the optimization vs. parsing that's a bit opaque and I'd
by hackcasual 10y ago
Not in this case, I'm preloading the wasm binary blob and then assigning it to the Module object.
With the optimization vs. parsing that's a bit opaque and I'd like more control over it. Right now our use case is such that only about 20% of the JS gets used in the first seconds of a users session, so we're paying startup time for code that either will get executed later or not at all.
- azakai 10y agoOh ok, yeah, if you preload the binary, it's a good measurement (of parsing + optimization). And yeah, it's common that most code is not used early. Browsers are implementing baseline JITs to help there, so they only fully optimize necessary code. I don't think any browser landed that yet though. Another option here is dynamic code loading, if you know some code is only needed later, you can load it yourself (dlopen, etc., which is supported already).