
Spidermonkey has passed V8 on Octane performance - francois2
http://robert.ocallahan.org/2014/10/are-we-fast-yet-yes-we-are.html
======
rdtsc
I have been very impressed by Firefox lately. Kudos to the whole team at
Mozilla.

Just about 5 years ago, it was looking to me like it was the end of Firefox.
It was Chrome all the way. New features were coming out one after another.
Faster rendering. Safe process isolation for each tab. Looked better.

But I just switched back last month. It happened kind of randomly. Saw an
announcement of a new release ( 33, I think ), downloaded, re-imported my
bookmarks from Chrome and just kind of kept using it instead of Chrome since
then.

I like how the tabs look also I think it feels lighter and snappier on my (now
old-ish) laptop.

~~~
MichaelGG
Same here. Especially as Google becomes more and more evil, Chrome looks less
attractive. Even on mobile, I use FF, despite it needing a lot of work and
having a lot of rendering and input issues. And Chrome on Android _looks_ very
sexy. On desktop, FF is fine, once more.

Rust is also one of the most promising languages with a potentially massive
impact on the world. Not only safer software, but exposing more programmers to
better ways of coding. (Imagine how different the world would be if a popular
OS had adopted a Rust-like two decades ago.)

Mozilla is really an important thing these days.

~~~
omeid2
I am actually still going back and forth between chrome and firefox and it's
design was something that was holding me back, specially in a stacking window.
Now looking at this I looked through themes and found Simple White[1]
something that way out dones chrome and et all in sexy factor.

[1] [https://addons.mozilla.org/en-
US/firefox/addon/simplewhite/](https://addons.mozilla.org/en-
US/firefox/addon/simplewhite/)

~~~
jasonkostempski
I would like it if something like that was the default and never changed. They
seem to keep trying to jump on whatever style is popular when they start a
redesign but by the time it appears in a release version it's way out of date.
The developer tools are even worse in this regard, they're not even consistent
with the rest of the browser. Themes are much better suited to keeping up with
trends, the default should be simple.

~~~
alex_duf
well styling is always a matter of personal opinion. I don't think Mozilla
should spend time on theming it's developer tools as long as it's readable and
usable.

For the main theme, as long as it's customizable to satisfy the 5% of grumpy
people I'm fine with that. The other 95% just doesn't care.

------
Jonanin
Check out [http://arewefastyet.com/](http://arewefastyet.com/) (the website
mentioned in the article), which tracks javascript engine performance.
Spidermonkey is faster than v8 and Safari's JSC on all three popular
javascript benchmarks [1]

[1] Octane (google's benchmark), Sunspider (Apple/Webkit's benchmark), and
Kraken (Mozilla's benchmark).

~~~
MBCook
Is there a reason they don't have the new Safari 8 FTLJIT in those numbers?
JSC (Java Script Core?) was Safari 7 wasn't it?

~~~
Jonanin
According to [1]: "Last week I asked for benchmarks of the new JavascriptCore
Fourth Tier LLVM JIT. Arewefastyet from Mozilla now includes such results.
FTLJIT does particularly well on asm.js examples."

You can see JSC performing better than chrome on the asm.js benchmarks:
[http://arewefastyet.com/#machine=12&view=breakdown&suite=asm...](http://arewefastyet.com/#machine=12&view=breakdown&suite=asmjs-
apps)

[1] [http://blog.llvm.org/2014/05/llvm-
weekly-19-may-12th-2014.ht...](http://blog.llvm.org/2014/05/llvm-
weekly-19-may-12th-2014.html)

------
cromwellian
"This puts us in a position of strength, so we can say "these benchmarks are
not very interesting; let's talk about other benchmarks (e.g. asm.js-related)
and language features" without being accused of being sore losers."

But are asmjs benchmarks interesting? They are not representative of the vast
majority of real-world JS, so wouldn't an asmjs-laden benchmark suite really
be a case of optimizing for your own set of benchmarks, tuned to your own
idiomatic-JS?

But anyway, congrats on the achievement. I like the fact that V8, JSC, and FF
performance are converging. If the performance differential is too great, it
creates additional headaches for the developer targeting a certain level of
efficiency.

~~~
sphink
Don't look at asm.js benchmarks if you're interested in real-world JS. Look at
them if you want to know something about the performance of C++ code
transpiled to run in a browser, which is an interesting thing to know. And
it's getting to be more and more relevant these days. (Even "real-world JS" is
going to start using asm.js libraries, I bet.)

But asm.js execution _is_ very different from JS execution, even in browsers
that don't have specialized asm.js paths. Executing regular JS is all about
balancing compile time and garbage collection with code execution. asm.js
barely uses GC, and allows lots of opportunities to cache compilation in ways
that would be invalid for regular JS. So the whole space of tradeoffs is
different.

------
orthecreedence
Firefox is awesome and I love it, but my one complaint after all these years
is that I have to restart the browser every day. It's not the end of the
world, but it's still frustrating, especially when I'm in the throes of
debugging or important research.

Over the course of a day, the browser becomes unresponsive and CPU usage
_idles_ at 10-15%. Restarting with the same tabs brings it down to 0%. Yes, I
know, disable addons, blah blah...doesn't work for me. Same problem.

I'm really looking forward to the new threading model coming up. I have a
feeling that once each tab has a thread, things like this will be much more
self-repairing. It's not always easy to kill a rogue execution path in an
event loop, but killing a thread is pretty straightforward =].

Also, congrats on the firefox team for really taking performance seriously.

~~~
keypusher
I've heard other people say this too, but it must be a workflow or use case
thing. I run Firefox as my browser of choice on Linux, Mac, and Windows every
day, and have for 10 years at least. I do remember a time when memory was an
issue, but those problems have been resolved for a few years. I routinely have
dozens of tabs open, often with Flash video or lots of javascript, sometimes
50 or more (with the excellent TreeStyleTabs plugin for hierarchical side
tabs) and I have never had these problems. I restart my browser maybe once a
month, usually along with OS updates.

~~~
lmedinas
Interesting that you are talking about RAM, but it's hard to beat Firefox
memory usage among major browsers. I'm impressed on my computers how Firefox
takes ~750 MB of RAM and Chrome with the same tabs takes ~1.4 GB RAM.

Kudos to the developers.

------
BorisMelnik
Love hearing this. I have been a Firefox user since Netscape 5, if that makes
sense. To me there might be some positives about Chrome but for me it is a
culture / community issue. It is a foundation I am willing to support during
the good times and bad, and I am not so hot about giving Chrome access to
every keystroke I make.

While this may sound petty, one feature I'd really love to see come back in
Firefox is the ability to see the _refresh button_ match the style /
movability of the back/home buttons. It is very annoying having to use precise
clicking on the eeeency little arrow on the URL bar.

But thats the thing, even if I am annoyed by small issues or lacking features,
I don't abandon a project based on that.

~~~
Kliment
right-click on the page and you have a refresh button right where your pointer
is

~~~
BorisMelnik
good call on that! did that get added within the last major version or two?

------
JohnBooty
I am ridiculously proud of Mozilla and everybody who has contributed to
Firefox over the years.

------
Igglyboo
As soon as firefox gets per process tabs in stable I'll switch back, I really
want to switch from chrome but that's a deal killer for me.

~~~
gojomo
I could survive without processes-per-tab, _if_ Firefox gave some hint – any
hint! – which tabs are being naughty. Maybe just a per-tab counter of
allocations, or timeouts, or DOM edits, or some other operation? Anything that
serves as a proxy for "more active than average while not in foreground".

~~~
__david__
Yeah, Firefox _really_ needs some sort of "top". Right now, idling, my Firefox
is taking between 20% and 40% of my CPU. I'm sure it's some tab running some
dumb javascript, but there's no way for me to figure out which one. Sad,
because spidermonkey _must_ know which window a javascript context is
associated with, so it could feasibly keep track of run time.

~~~
bzbarsky
SpiderMonkey itself actually has no concept of windows at all. So it doesn't
know what window anything has to do with.

The browser itself does, though. Some sort of "top"-like utility is in fact
being worked on, for both websites and extensions.

~~~
sp332
If a script hangs, Firefox has a little popup on that tab that asks if you
want to kill it or let it keep running. So something in the browser knows
which tabs are JS-intensive.

~~~
bzbarsky
Sure. That particular setup has pretty low overhead and hence also low
granularity; it's not measuring intensive or not but just how long a script
has been running when a timer on a background thread fires. So your script
could be eating up all the CPU but just returning to the event loop every few
seconds and the hung script dialog would never notice.

------
dmix
This reminds me of the cell phone industry competition. We all benefit from
head-to-head fights for performance and value. It's a shame so many markets
have little direct competition outside of technology either due to monopoly,
regulatory capture, or market dynamics.

------
general_failure
Kudos. But they should really invest time in making the UI responsive and
fast. This is my biggest gripe about firefox. I also find it incomprehensible
that it checks for updates on startup in a modal fashion. Very annoying.

~~~
nathancahill
What version of Firefox are you using? It hasn't done that in ages. You have
to open the About window to check for new updates and install them.

~~~
kbrosnan
Non-Windows still has modal update dialog. On startup for non-Windows you are
blocked from using the browser until the update is complete. There is a dialog
if you run out of date extensions. There is a nag dialog if you have an update
pending for over 24h.

~~~
nly
What platform? Most Linux distros compile Firefox with "\--disable-updater
--disable-installer", such that Mozillas auto-update doesn't even exist.

~~~
kbrosnan
OS X and Mozilla Linux builds.

------
zobzu
"Spidermonkey has passed V8 on Octane performance on arewefastyet, and is now
leading V8 and JSC on Octane, Sunspider and Kraken." (ie faster than Chrome on
Chrome V8 benchmark)

Good job Mozilla!

------
untilHellbanned
I can really feel the swing back to Firefox happening like the switch to
Chrome back 5-7 years ago.

Go Firefox!!!

p.s. Great work on Firefox OS too!

~~~
zobzu
Yeah. Unfortunately for Mozilla, they don't have a download button on the #1
page on the web (google.com) and they dont bundle it either with any OS
(Windows + IE, Mac/iOS + Safari, Android + Chrome) or software (Chrome auto
installed from Flash upgrades, etc.)

So I don't know how strong the switch back would be...

------
kevincennis
This is cool, but Firefox still _feels_ a lot slower to me than Chrome.

I think Mozilla would get a lot of mileage out of improving the performance of
the rendering engine. FF doesn't feel slow because of JS, it feels slow(-er
than Chrome, at least on my Mac) because repaints and layout seem to take
longer.

~~~
agapos
They are working on it on several fronts, constantly cutting off tasks from
the main thread onto their own ones (downloading, cache v2, Awesomebar),
making other things asynchronous (project snappy), garbage collection
improvements also help in some cases. Most of these are smaller wins, and
several big ones like OMTC, tiled rendering or e10s are yet to come.

Edit: It may not be as responsive as Chrome (I don't know as I don't use it),
but I believe it is miles ahead of it's former self.

------
bobajeff
>This puts us in a position of strength, so we can say "these benchmarks are
not very interesting; let's talk about other benchmarks (e.g. asm.js-related)
and language features" without being accused of being sore losers.

I'm looking forward to such a statement from Mozilla. The web needs mature
suppott for languages other than JavaScript and C++/C are very widely used
languages(as opposed to some new hobby language) and compile to JS tools are
the only realistic way of getting there. So I can hardly wait until browser
venders and standards organizations embrace efforts like Asm.js and the
nessary extensions to make it support other memory and language models and
features (Shared memory, SIMD, JVM languages etc.).

------
pjmlp
Great work!

Improvements like this and Rust, is where I like seeing Mozilla spending their
resources.

------
vuldin
Mozilla is one organization that I have no problems supporting. Thanks to
everyone involved with Mozilla for contributing to a great organization that
does awesome stuff.

~~~
sphink
I pointed my smile.amazon.com account at the nonprofit Mozilla Foundation.

(Which isn't entirely altruistic; I am employed by the Mozilla Corporation.
But hey, I _do_ support Mozilla's mission; what can I say?)

------
piyush_soni
I still use Firefox as my main browser, but while it has improved a _lot_ in
recent times, I don't know why are some root problems not getting fixed -
memory hogging, browser hangs, crashes (yes, I still get them on my
workstation - I've even reported the callstacks to them). Mostly, the answer
is, "It's your add-ons" \- oh yes, but when it comes to talking about their
strengths, this is one of the first things they talk about - "add-ons".

For example, every other browser fixed this 12 year old bug [0] one by one,
but Firefox doesn't care much about it. In fact, not only that they don't have
_any_ solution to it whatsoever, when people's resentment about the bug
increased, they chose to just shut down their voices on it.

[0]:
[https://bugzilla.mozilla.org/show_bug.cgi?id=78414](https://bugzilla.mozilla.org/show_bug.cgi?id=78414)

~~~
kbrosnan
That bug is intractable with the current NPAPI and plugin vendor landscape.
Slowly plugins are being replaced by web accessible technology. That is the
way forward.

There are some things a user can do to avoid the issue as much as possible.
Setting all plugins to ask to activate in about:addons resolves a number of
common occurrences where plugins take focus on load. Set YouTube to use the
'HTML5' player [0]. Use pdf.js. If you are on OS X 10.7+ use Mozilla's Aurora
branch to get h264 playback [1]. If you develop sites check for support of
h264 playback instead of assuming Firefox does not have it.

[0] [https://www.youtube.com/html5](https://www.youtube.com/html5) [1]
[https://aurora.mozilla.org](https://aurora.mozilla.org)

------
Tloewald
Firefox's hopeless video and audio implementation (especially on Mac OS X)
remains a deal breaker for me. It means resorting to Flash in a lot of cases,
which means I use another browser.

I'm glad to see strides being made in JavaScript performance, but basic
browser functionality is far more important.

~~~
kevingadd
HTML5 video and audio in Firefox works perfectly in every site I visit. What
problems do you hit? I haven't used it on Mac so perhaps the support is less
good there.

Some sites don't attempt to use <video>/<audio> in Firefox for me, but that's
a site issue, not a browser issue - h264 and webm both work fine.

~~~
dbcooper
There are a few google related ones in Karl Dubost's list:

[http://www.otsukare.info/2014/10/28/google-
webcompatibility-...](http://www.otsukare.info/2014/10/28/google-
webcompatibility-bugs-list)

------
Sephr
Octane now includes asm.js benchmarks, and V8 doesn't attempt to support "use
asm". This gives SpiderMonkey an advantage in the benchmark.

I think it's quite impressive how close V8 is in performance to SpiderMonkey
which actually goes out of it's way to support "use asm".

~~~
nnethercote
This comes down to your definition of "support".

Unlike SpiderMonkey, V8 doesn't have a special mode for "use asm" code, as far
as I know. E.g. it still does JIT compilation, unlike SpiderMonkey, which does
AOT compilation.

But the V8 team is certainly working on making asm.js code fast. This is clear
from the fact that V8's performance on asm.js benchmarks has increased
significantly since asm.js was first announced. (As you note, they put an
asm.js test in their own benchmark suite.)

And even if V8 doesn't have a special mode for asm.js, they're benefitting
from asm.js's existence, because asm.js makes clear exactly which subset of
JavaScript they need to be optimizing for.

~~~
cpeterso
V8 has an experimental new JIT called "TurboFan". AFAIK, it doesn't do AOT
compilation of asm.js code, but the "use asm" directive (among other cases)
will force TurboFan mode.

[https://news.ycombinator.com/item?id=8117091](https://news.ycombinator.com/item?id=8117091)

------
cddotdotslash
While this is great for those keeping track of the stats, I doubt it will have
much effect on the average consumer. Almost everyone I know uses Chrome; that
includes family members, co-workers, tech-minded and non-tech-minded people
alike. For them, it's been IE vs Chrome for awhile and telling them "Firefox
is a tad bit faster" isn't enough to make them switch again. Unfortunately, I
think Firefox lost too many people during its sluggish phase awhile back and
it's going to be tough getting them back.

Also, as much as I keep hearing "Google is evil" in the tech echo chamber,
again, the average consumer doesn't care. Even I know Google's policies and
still choose to use Chrome purely because it's more convenient.

~~~
e12e
> Even I know Google's policies and still choose to use Chrome purely because
> it's more convenient.

What do you find is more convenient with Chrome over Firefox?

I don't (yet) use all of the sync features in Firefox, but just having a
unified history on Android and desktop is quite convenient, as is syncing
saved passwords -- and knowing both how data is handled, and that I _can_ set
up a personal sync-server if I want to (actually tried that with the previous
generation of sync) -- gives me peace of mind.

~~~
cddotdotslash
Allow me to speak from the mindset of a consumer. The average consumer doesn't
care about Firefox's data storage policies or how much they cooperate with the
government. They care that things just work and are fast enough. For me, the
convenience of Google Chrome comes from the fact that it is tightly integrated
with all of Google services. I can use one Google account to log into my
browser, access my email, set up a calendar, etc. Sure, Firefox can do syncing
too, I just prefer using one company that does it all rather than two that do
half.

Also, unrelated, I think Firefox spent too long copying Google Chrome's
interface and now they are playing catch up.

Regardless, Firefox usage continues to decline month after month. I think
they've lost the general consumer appeal.

~~~
e12e
I'd be much more interested in what you think personally, than what "a
consumer" might think. I'm perfectly aware that a lot of the things that
matter to me, doesn't seem to matter to a lot of people. Do I understand you
correctly, in that:

1) You use gmail and Google calendar, therefore

2) You want your passwords, extensions, bookmarks and browser history synced
by the same provider that provides your email and calendar hosting

3) You don't care if you can never (reasonably) move away from that provider

For you, Firefox would be as nice as Chrome, if: Firefox provided free/cheap
(web)email and calendar hosting in addition to the sync services? Or if a
third party offered paid hosting for Firefox sync along with (web+imap+smtp)
email and calendar (ical) services? (Sounds like something fastmail should
consider..?)

I'm not trying to be snarky, I just genuinely want to know in what way you
think Firefox could (should) improve -- it sounds like the only thing missing
is more services hosted under a single login?

~~~
cddotdotslash
Well personally, I am probably not the average HN reader in that I have little
problems giving up personal information in exchange for access to new
services, free services, etc. So in that regard, Google more or less fits my
mindset. As far as improving, I don't know - Firefox is already an excellent
browser that is fast, secure, and pretty standard-compliant. It definitely
beats IE.

What I've been trying to communicate is that I think the general consumer
tends to be drawn to tightly integrated services - one provider can handle
their email, their calendar, their browser, their phone's OS, etc. While this
raises issues within the HN-crowd, my anecdotal evidence* supports the fact
that the average user has little knowledge or desire for efforts to "protect
their privacy." In general, they trust Google and don't have a need to switch.
I've yet to convince anyone to switch from Chrome to Firefox over privacy
arguments, but I have managed to get almost everyone I know to switch from IE
to Chrome simply by telling them "it's Google."

* Family, friends, and family's co-workers

~~~
e12e
I certainly appreciate the convenience of having one (service) provider. Not
very important to me (I'm aware of the trade-offs involved) -- but that
doesn't mean I'm blind to how most people feel. Funny that the only thing
that's not (AFAIK) part of Mozilla yet, is cloud storage. With more Firefox
apps, it's not inconceivable that there'll be a viable docs-alternative -- and
as for phone os, there is of course Firefox OS...

------
EduardoBautista
You know, I just don't know who to believe these days when it comes to browser
benchmarks. All browser vendors pretty much say they lead all browsers in
_something_. Honestly, I don't even know what all these benchmarks mean most
of the time.

~~~
hornetblack
The point in this one is SpiderMonkey is beating V8 in the benchmark designed
such that V8 wins on it.

~~~
ivanca
Yeah, no. They chose intensive process, many of them are ports of code from
other languages and some the tests are using software made by Mozilla such as
pdf.jz and zlib (Ecmascripten) and Microsoft (Typescript compiler)

[https://developers.google.com/octane/benchmark](https://developers.google.com/octane/benchmark)

~~~
roca
But they also included stuff like splay-latency which explicitly tests
something that doesn't matter on the Web (support for incremental GC during
script execution, which doesn't matter in browsers because the effects of a
script are never made visible to the user until the script ends). Guess what,
V8 has that and Spidermonkey doesn't.

~~~
magicalist
Can you explain more what you think is unfair about the test? I've only given
it[1] a brief read and it certainly is a synthetic benchmark, but it doesn't
seem absurdly artificial.

I've certainly written JS that builds trees, modifies them, tears them down,
and builds new ones, all within the same event loop turn, and so would
certainly benefit from incremental GC in the cases when the data it's working
over is very large (or it's just a part of an app that's already been burning
through a large number of allocations).

[1] [https://code.google.com/p/octane-
benchmark/source/browse/tru...](https://code.google.com/p/octane-
benchmark/source/browse/trunk/splay.js)

~~~
roca
Your app won't benefit from incremental GC during an event loop turn, because
nothing your script did before the incremental GC slice will be made visible
to users until the entire event loop turn is finished.

~~~
ivanca
But what about the all the other processes in the device? There may be another
process at the same time who may benefit from such GC, perhaps a video being
played inside a plugin, or just Photoshop being run side-to-side with the
browser and things like that.

It may not benefit the app but it may benefit the user, which is clearly a
relevant metric.

------
SwellJoe
I switched back to Firefox from Chrome a couple years ago, because I no longer
trust Google to have my best interests at heart. It's been fine; I have a
beefy machine with plenty of RAM, but I also use it on my horribly slow
Android phone (an old HTC Sensation 4G that has never been worth a crap), and
it works OK there, too.

My only complaint is that it requires a plugin to get a reasonable number of
tabs in a window before requiring scrolling. It's downright absurd that it
stopped being configurable many, many, many versions ago.

~~~
barrkel
TreeStyleTabs.

------
joemccall86
I keep going back and forth between Firefox and Chrome. Chrome is ahead right
now for two reasons:

1\. Support for Netflix on linux

2\. Webapps as native applications (like the old project prism). We use slack
at work and a Chrome webapp is how they choose to support Linux.

Admittedly though, I will switch to Firefox for the rest of the week to see if
I can live with these caveats.

~~~
dethstar
I use Netflix on Linux (firefox) with pipelight.

------
Rapzid
I had another look at FireFox the other day. Impressed with their editable
layout and smooth interface. Less impressed with the Network tools pane in
comparison with Chrome(chrome shows compressed/inflated size, can view and
copy raw headers, etc). Still, it's in my to-do to give it some game time.

------
arthursilva
Damn, where's the super like button on this. Kudos to all contributors (and
donators)!

------
tkubacki
kudos for Firefox team. I hope they put more love in speeding up css
animations (like here:
[http://bartaz.github.io/impress.js/#/bored](http://bartaz.github.io/impress.js/#/bored))

------
bruceboughton
It would be interesting to now how Firefox performs with regard to battery
usage. Apple in particular seems to be focussing on battery life as much as
performance, given that the codebase is shared across iOS and OS X.

------
themechanic
Kudos to all involved in making this happen.

------
dude3
Please now work on translate3d performance!

------
whoisthemachine
Good job guys!

------
notastartup
You know whats funny, I stopped using Chrome and use Firefox now because
Firefox is so much faster. The exact same reason I switched to Chrome 5 years
ago. Also I'm slightly less creeped out.

~~~
sphink
I think this is pretty common. In fact, this can happen even if neither
browser changes at all. Your profile builds up and your history searches etc.
slow down, so you switch browsers and get a clean profile to start with.
Repeat. (I'm not saying that that is what you are experiencing, but I think
it's a factor for every browser user.)

