WebAssembly, JavaScript links get faster in Firefox

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

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.

Join the newsletter!

Or

Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags WebAssembly

More about AppleGoogleMicrosoftMozilla

Show Comments
[]