Impressive WebAssembly Performance gains in Firefox

Mozilla has been on the forefront of WebAssembly development, a relatively new technology that offers better performance on the Web than JavaScript in many cases.

WebAssembly offers several advantages over JavaScript. It takes less time to fetch, decode and compile WebAssembly code compared to JavaScript. You can check out this overview on Mozilla Hacks for a detailed article on the differences between WebAssembly and JavaScript.

Edge's performance looks impressive on first glance but if you read this article on the MS Edge Development blog you will notice that Edge defers parsing WebAssembly functions until they are called.

Under the hood, Chakra defers parsing WebAssembly functions until called, unlike other engines that parse and JIT functions at startup time.

Lin notes that the optimizations allow Firefox on the desktop to compile 30 to 60 Megabytes of WebAssembly code per second. On "a pretty average" mobile, Firefox manages to compile 8 Megabytes per second.

Firefox users who run Beta or Nightly versions of the web browser can test the functionality already. You can run the basic benchmark that I linked above to see the difference, or run real-world applications or games that use WebAssembly instead.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

About Martin Brinkmann

Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand.You can follow Martin on Facebook, Twitter or Google+

@Anon: He is probably still negative about the product because the small benefits pouring in very, very slowly are not outweighing the negatives, at all.

As for myself, I appreciate the performance improvements. However, I see no point in putting others down the way you do. If you are dead-set on putting others down, do it with facts at least. Ad hominem stuff is way too obvious and an embarrassment to begin with.

@Appster Honestly, my bad. It’s just that this site is filled with so much negativity that it gets to a point of ridiculousness. Everything Mozilla does it’s like the end of the world for some users.

They could make the best browser in the world with the best performance, dev tools, UI/UX, etc., and these guys would still bitch and moan or threaten to go to another browser because they changed a button or some insignificant detail.

It’s pretty much a thankless job to the guys at Mozilla. Nothing is ever good enough. I’m not excusing some of their decisions and I do not agree with everything they do. And when that happens, I voice my opinion in a constructive matter as we all should.

But still i’m thankfull for their work since it’s the only good independent browser we have and to be perfectly honest, they don’t owe us a damn thing.

P.S Do not work at Mozilla, use 3 different browsers so i’m not a fanboy.

@Anon: “But still i’m thankfull for their work since it’s the only good independent browser we have”

Well, I don’t agree that it’s the only good independent browser we have. It’s not even one of the better ones, in my opinion — but what’s “good” or “bad’ in this sort of thing boils down to whether or not it meets my needs. It’s necessarily a subjective assessment.

You’re right, Mozilla owes us nothing. But I’ve been using FF since the beginning (and have been financially contributing), and so I have a deep emotional connection both to Mozilla and FF.

That’s why I find the release of Quantum so painful — it has become a browser that no longer meets my needs. I’m clearly no longer part of Firefox’s intended customer base, and that reality is a bitter pill to swallow.

@Anon said on January 18, 2018 at 4:03 pm: Mozilla *had* the best browser, and browser community–of developers especially. They threw it all away–literally–for the sake of being Chrome-compatible. Our sentiments have nothing to do with Australis and Fx29. It’s about XUL and everything else Mozilla tossed along with it. The [former] long-time users of Firefox felt betrayed by Mozilla… and they had the right to. Nothing about that has changed, nor should one expect that it will. Certainly not with regard to something like WebAssembly, which all of the “leading” browsers are in the process of adopting.

My arguments were always based on facts. Not just “ad hominem / I don’t like your face / You must be sad or stupid” stuff. People are free to disagree with me. And I am free to disagree with them. People who insult me will be dealt with accordingly.

Well, then. Safari 11 is still a little bit faster than FF Quantum on my MacBook. The deciding factors when it comes to speed are your bandwidth as well as your hardware, anyway. FF Quantum will be no good on an Intel Atom with 20 kbit/s download speeds.

Where do you live that being able to surf the web on a 2G cell network is a concern? Is surfing the web on 2G a thing now? I don’t remember it being a thing 10 years ago, much less now. Hell, everybody I’ve heard of is shutting down their 2G networks. Dial up? I feel for you.

Uhm, Richie… That’s not MY connection speed. It was just an example, one that I used to illustrate how the browser is not the deciding factor when it comes to speed. Hardware and bandwith are far more important. So I don’t see the point in saying “Wow, Quantum is so fast!” when this is in fact only determined by bandwith speed and hardware. It’s a pointless sentence. Even if it was faster than FF56 on decent hardware and decent bandwith, it would hardly be visible for the human eye. Unless you are a cyborg, of course.

Just out of curiosity, have you tried reducing the “Content process limit” from the default of 4 to maybe 1 or 2? I use the default of 4 with 57+ but if I use only 1, I can’t really perceive any difference in performance but then I seldom have more than a dozen tabs open, and even when just using 1 content process FF will still show 4 processes in the Windows Task Manager. Fact is I have FF 56 and Waterfox installed and I have them set to use one content process and they both work very well. Just wondering what kind of impact reducing the process count would have on battery life. Might be worth a shot.

@ Richard Allen: I have tried to play around with the number of content processes, but it doesn’t seem to make much difference.

@ Sigmar: The test video you’ve linked to was performed on a desktop iMac, and is not at all representative of what happens on a battery-run MacBook Pro. My point about Energy Impact is that FF57 has a much larger number of CPU spikes which significantly reduces battery life compared to Safari or even Opera. This is often translated into Average Energy Impacts in the three figures.

@ Mike: I’ve read some of those Reddit discussions, and they make me hopeful that some day FF may be on equal battery footing with Chrome, though probably not with Safari. Still, it is incredibly frustrating that one’s favourite browser – with all these shiny new Quantum improvements – drains your battery liked a milked cow.

@ ShintoPlasm: I agree that it is frustrating that Firefox suffers from such poor battery life at times, because Quantum is extremely snappy and a pleasure to use. Opera is still my go-to Chromium browser due to its battery optimizations (on both Windows and Mac), but I am hopeful that the Firefox devs will put a greater emphasis on battery/power consumption optimization in 2018 (along with mobile, where Firefox is terrible on Android for page loading performance). Now that Quantum has been released and the next couple updates (58, 59) will include bug fixes and performance optimizations to the Quantum engine, hopefully emphasis will switch over the improving battery life. Battery life struggles have long been an issue for Firefox, so hopefully it is on the radar of the organization’s developers.

I agree, but I would also not that on the Firefox Reddit page, Firefox developers have noted that they are aware that Firefox Quantum is using more energy consumption that they would like and that subsequent updates (58, 59, etc.) should address this problem. While I agree it is difficult to do a “one size fits all” assumption regarding battery life, Firefox 57 is poorly optimized (battery wise) for Mac OS.

Side notes: – This is a decent i5 (5675C) with 16GB RAM, W1064. Connection is 4G/LTE. Large bandwidth but latency as well. – FF59 literally crushes FF ESR (52) performance-wise. To the point that I have been running nightly more and more since 59, when I would stay in ESR until now, due to legacy extensions. The benefits in FF development trends are really starting to show for me, justifying the hassle of reconfiguring worskspace and switching extensions when it can be done..

About gHacks

Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.