Mozilla: Firefox 58 can load WebAssembly on pages faster

Spread the love

Firefox 58 includes two features that make running WebAssembly on pages faster: the streaming compilation feature and a 2-tiered compiler. In addition, Mozilla will require https with upcoming Firefox web-facing features.

When using Firefox 58 on a desktop, the browser can compile 30 to 60MB of WebAssembly code per second, compared to 8MB/s on an average smartphone. That’s faster than most network speeds and means code is executed almost immediately after download, said Mozilla’s Lin Clark. The improvements come from Firefox 58’s use of WebAssembly’s streaming API. This allows the code of a .wasm module to be already compiled while the module’s data is being downloaded. “This makes the cost of loading WebAssembly more like decoding an image than loading JavaScript,” claims Clark. WebAssembly is a standard for compiling code on the web and an alternative to JavaScript that Mozilla notably puts forward as such.

Not only does support for the streaming API allow Firefox to start compiling earlier, but using a 2-tiered compiler makes it faster. The tier 2 compiler provides optimized code in the background while the tier 1 compiler is busy processing incoming code. Firefox 58 is currently still in beta.

In another Mozilla message, Anne van Kesteren announces that with immediate effect, new web-exposed functionality of Firefox must adhere to secure contexts. Secure contexts is an upcoming W3C standard that should ensure that certain content is brought in via an encrypted connection and thus prevent a man-in-the-middle attack. With Firefox this concerns functionality that is ‘visible’ from a web page or server, whether this is via JavaScript, CSS or http. Mozilla lists as functionality extensions, new http response headers and WebVR.

BrowserClarkCSSDownloadFirefoxJavascriptMozillaSmartphoneStreaming