Paul Krill
Editor at Large

Microsoft fine-tunes WebAssembly for Edge browser

news
Apr 21, 20172 mins

By tweaking when the Chakra JavaScript engine parses WebAssembly functions, the Edge browser provides faster web app performance

guitar tuning
Credit: clusternote

WebAssembly, the portable binary format for improving web application performance, is being tweaked by Microsoft for its Edge browser.

With the browser featured in the recent Windows 10 Creators Update, the Chakra JavaScript engine defers parsing WebAssembly functions until called; other engines parse functions at start time.

“We’ve observed startup time as a major headache for large web apps and have rarely seen runtime performance being the issue from our experiences with existing WebAssembly and asm.js workloads,” said Limin Zhu, program manager for the Chakra team at Microsoft, this week. “As a result, a WebAssembly app often loads noticeably faster in Microsoft Edge.”

WebAssembly MVP (minimum viable product) currently is supported behind the Experimental JavaScript Features flag in Edge, Zhu said. Aside from the Creators Update, Microsoft is tuning WebAssembly performance and working on remaining MVP features, including response APIs and structured cloning, before WebAssembly is turned on by default in Edge.

Users need to check the “Enable experimental JavaScript features” box in about:flags to turn on WebAssembly and other experimental features, such as SharedArrayBuffer. But a commenter on Microsoft’s bulletin about WebAssembly was all for using the technology right now. “Seems like with all of the promise of WebAssembly, you would skip ‘experimental’ and go straight to ‘replace my slow JavaScript with this incredible tech that is 20x faster and awesome than JS could ever hope to be.’ In fact, Edge is now a WebAssembly browser.”

WebAssembly has been lauded by JavaScript founder Brendan Eich, who has said it “becomes the safe native format for the Web” at some point. Recently moving to MVP status, WebAssembly has been backed by major browser vendors, including Apple, Google, Mozilla, and Microsoft.

The Creators Update also features other improvements, including saving memory by re-deferring functions. The capability descended from Internet Explorer’s defer-parse function and defer-parse event handlers. With re-deferring, for every function Chakra deems would no longer get executed, the engine frees the bulk of memory that function holds to store metadata after pre-parsing, leaving the function in a deferred state as if it has been pre-parsed. Creators Update also extends just-in-time optimization to avoid creating heap arguments with the presence of formals as long as there are no writes to formals. Microsoft’s web crawler estimates this optimization benefits about 95 percent of websites.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author