Hello! Welcome to another episode of the SpiderMonkey Newsletter. I’m your host, Matthew Gaudet.
In the spirit of the upcoming season, let’s talk turkey. I mean, monkeys. I mean SpiderMonkey.
Today we’ll cover a little more ground than the normal newsletter.
If you haven’t already read Jan’s wonderful blog about how he managed to improve Wasm compilation speed by 75x on large modules, please take a peek. It’s a great story of how O(n^2) is the worst complexity – fast enough to seem OK in small cases, and slow enough to blow up horrendously when things get big.
🚀 Performance
-
Awesome contributor Debadree has added IC support for addition and subtraction on Date Objects
-
Jan worked on saving fewer registers when calling out to C++ code, providing a 5% improvement on some speedometer subtests.
-
Jon improved the performance of store buffer iteration by avoiding linked-list traversal where possible.
-
Jon improved the performance of sweeping by doing more work without holding a lock
-
Jan continued improving register allocation by choosing a better representation for sparse bitsets, improving compilation time on a wasm module by 40%, and improving some PDF test cases by 5%.
-
Jan worked on Map and Set Optimizations, with improvements across a number of benchmarks.
👷🏽♀️ New features & In Progress Standards Work
-
The WebAssembly Memory64 proposal has reached stage 4 and is enabled by default in Firefox 134. This proposal finally adds 64-bit pointers to WebAssembly—although this comes with some downsides, so stay tuned for a blog post exploring this subject further.
-
Prolific contributor André has worked on over 30 (‼) bugs in this newsletter time frame. Feature wise he’s continued his incredible stewardship of the Temporal proposal, as well as implementing Int.Duration format, providing initial implementation of Atomics.pause.
-
Speaking of great contributors: Debadree has continued work on the Explicit Resource Management proposal, with the implementation looking like it’s in great shape.
-
Dan has been on a roll shipping proposals: Promise.try, Regexp.escape, and Regular Expression Pattern Modifiers.
🚉 SpiderMonkey Platform Improvements
-
Jan has killed a whole class of errors that have bedevilled SpiderMonkey developers for at least 15 years. The root cause of the issue is the overloading of error checking inside of SpiderMonkey. The general case is “Report an Exception” and return false.
The problem is that, returning false without setting an exception -also- has a meaning: It’s throwing an uncatchable exception, which is used for things like unwinding when you stop a script due to the slow script dialog.
So what happens if you were to accidentally return false without setting an exception: Did you mean to do that? Or did you forget? In Bug 1921215, bug 1921780, and bug 1921963 Jan has tidied this whole story up with a new helper
JS::ReportUncatchableException
and assertions that validate you’ve used this correctly! -
Debadree added support for generating LIR ops where they are pretty straightforward boilerplate. This will reduce the amount of work we have to do when improving the JITs. Previous work like this has been appreciated hugely, and I expect we’ll find lots of value in this quickly.
-
Denis has made
--enable-perf
the default for nightly builds, which will make profiling Firefox more effective. -
A few years ago our OS integration team deployed a neat trick on Windows to reduce out of memory errors in Firefox, written up in this wonderful blog post. Recently Jon went through the effort to apply this same weird trick to our own memory allocation. Our hope is that this will reduce the amount of out-of-memory failures.