Paul Krill
Editor at Large

WebAssembly, JavaScript links get faster in Firefox

news
Oct 15, 20182 mins

The Firefox Nightly beta makes these calls run faster than non-in-lined JavaScript-to-JavaScript function calls

Mozilla Firefox headquarters
Credit: Magdalena Petrova/IDG

Mozilla’s latest beta version of the Firefox browser, Firefox Nightly, makes calls between the WebAssembly binary format and JavaScript faster, so it is easier to combine the two languages.

WebAssembly can serve as a companion to JavaScript in web development, taking on performance-intensive tasks. But thus far, combining the two has been hindered by slow function calls between the two languages, Mozilla says.

The Firefox Nightly beta makes these calls run faster than non-in-lined JavaScript-to-JavaScript function calls. Calls have been optimized from JavaScript to WebAssembly and vice versa. Mozilla also has improved the speed of calls from WebAssembly to built-ins, which are functions given by the browser such as Math.random.

Optimizations to calls from WebAssembly and JavaScript fall into two categories:

  • Reduction of bookkeeping by eliminating unnecessary work to organize stack frames.
  • Bypassing of intermediaries, by taking the most direct path between functions.

Mozilla’s latest effort to improve WebAssembly’s speed follows previous efforts that emphasized throughput and better load times. Future plans call for in-lining WebAssembly into JavaScript; currently, the only case where an optimized call from JavaScript to WebAssembly is not faster than a JavaScript-to-JavaScript call is when JavaScript has in-lined a function. In-lining provides a shortcut for a function that calls the same function over and over again.

Mozilla expects other browsers to follow in its footsteps and also improve call speeds between WebAssembly and JavaScript. Apple, Google, and Microsoft have participated in WebAssembly’s development.

Where to download Firefox Nightly

You can download Firefox Nightly from mozilla.org.

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