SpiderMonkey is the JavaScript engine used in Mozilla Firefox. This newsletter gives an overview of the JavaScript and WebAssembly work we’ve done as part of the Firefox 114 and 115 Nightly release cycles.
We’re working on improving performance for popular web frameworks such as React. We can’t list all of these improvements here, but the list below covers some of this work.
Array.prototype.concat from self-hosted JS code to C++. The new implementation is a lot faster especially for arrays with many elements.undefined from the JITs to the bytecode emitter, so that these are also optimized in the interpreters.Array.fromAsync in Firefox 115.isWellFormed and toWellFormed functions for strings (disabled by default).High-level programming languages currently need to bring their own GC if they want to run on WebAssembly. This can result in memory leaks because it cannot collect cycles that form between browser objects and the Wasm code. The Wasm GC proposal adds struct and array types to Wasm so these languages can use the browser’s GC instead.
We’re working on improving our implementation of modules. This includes supporting modules in Workers, adding support for Import Maps, and ESMification (replacing the JSM module system for Firefox internal JS code with standard ECMAScript modules).
JSContext dependency for off-thread parsing and also for the JSON parser. This lets us parse JS and JSON on background threads with very little overhead.