
JavaScript speedups in Firefox 3.6 - indy
http://hacks.mozilla.org/2010/01/javascript-speedups-in-firefox-3-6/
======
rufugee
I'll be interested in Firefox again when they get process-per-page going.
After becoming so spoiled by this in Chrome, I just can't go back...yet...

~~~
cookiecaper
Mozilla really needs to step it up. TraceMonkey is still way behind V8. They
need to do something to get competitive with Chrome in terms of performance,
or there's no possibility of ever switching back for me. Chrome is always 2-3x
faster.

~~~
FooBarWidget
"Always"? Check out <http://portfoli.no/>, Firefox 3.6 vs Chrome:
<http://www.youtube.com/watch?v=lQ2PDbffKuQ>

~~~
cookiecaper
"Always" in my experience, anecdotally. I am sure there are some crafted
benchmarks that favor Mozilla, but they're not really fair; in every real-life
deployment I've seen personally, Chrome has crushed Firefox. There may be some
edge cases where Firefox performs better, but Chrome is by far the faster
browser for real-life browsing.

------
tolmasky
I'm not getting very good numbers on my machine (much higher gc times than the
article suggests). Perhaps it's because I'm on a mac, but it's a pretty new
MacBook and safari seems to perform much better on a number of them.

~~~
SwellJoe
_safari seems to perform much better on a number of them_

The benchmarks on the page are mostly not intended to test relative
performance across browsers other than Firefox, and almost certainly do not
provide useful comparison data. They were mostly designed to exercise
particular performance weaknesses in Firefox, and indicate whether those
performance weaknesses are improved by the new code. Micro-benchmarks in the
context of very large, complex, systems, are usually pointless...except when
going after particular performance issues, as the developers of Firefox are
doing.

~~~
DEinspanjer
I've been investigating a similar disappointing performance of that benchmark
on my Mac install of 3.6. Turns out that Firebug and Adblock Plus can both
double the GC delay time.

Trying to figure out what information to collect to report that in bugzilla
right now.

~~~
SwellJoe
The number of hooks in Firefox seems likely to be a contributing factor in it
being somewhat slower (in some regards) than Chrome and Safari, which are both
extremely basic in their customizability and extensibility via third party
plugins. Flexibility does usually have a cost, in software and in physical
systems, and Firefox definitely goes to the extreme on flexibility. I'm about
50/50 on whether the trade is worth it, and I waffle between Chrome and
Firefox as my primary browser.

Firebug and AdBlock Plus are both quite demanding plugins, having to analyze
and manipulate the DOM so often and in so many ways. I don't think one can
expect them to have no impact on performance.

------
einaros
I wrote a completely useless 3D effect using DOM manipulation some time ago
(<http://portfoli.no>), and have been using it since to do my own personal
benchmark of various browsers. Being horribly unoptimized, and probably
riddled with flaws, it seems a fair middle ground for most JavaScripts out
there.

FF3.6 is (obviously) by far outperformed by Chrome, but it seems to me that
even 3.5x did a better job of running it. In either case, the 3.5->3.6
difference seems marginal for this one.

~~~
FooBarWidget
Your site is actually slower in Chrome than FF3.6 for me. Mouse over is about
10 times (!) slower and scrolling is about 2-3 times slower.

~~~
einaros
Which Chrome version is that? v3.0.195.38 runs it without a glitch here. I did
a screencapture, but Jing can't quite keep up with the framerate of the
animation, so that looks jumpy (<http://screencast.com/t/ODQxMTdmMzg>).

~~~
FooBarWidget
v4.0.249.49 for the Mac.

This isn't the only site that Chrome is slower on. There was a link on Reddit
or HN a while ago about an image blurrer that was entirely written in
JavaScript. FF 3.5 managed to be 2-3 times faster than Chrome for that
particular page.

Chrome is faster than FF 3.6 on some sites, like Mockingbird, but it does not
always outperform FF.

~~~
einaros
I've yet to try the v4 beta. Seems unlike that they've taken such a huge leap
back from v3, though. I'm more inclined to say that Google's implementation on
MacOS is inferior to Mozilla's.

Did you ever measure the difference with the Windows versions of the browsers,
on said web sites?

~~~
FooBarWidget
No, it's been ages since I've used Windows.

In any case, FF 3.6 definitely doesn't feel slow on that site. Everything is
pretty smooth except for scrolling which is a _little_ jerky.
<http://www.youtube.com/watch?v=lQ2PDbffKuQ>

All in all FF 3.6 is a very nice update. It's noticeably faster than 3.5 on
many websites. I used to use Firefox for general browsing and keep Chrome
around for a few select websites that Firefox was slow at, but with this
update FF is sufficiently fast so I don't need Chrome anymore.

------
arnorhs
I've got a pretty weak single core laptop and I have to say those benchmark
tests are by far much much much faster in ff3.6, these are my results:

Garbage collection:

19 - 14

651 - 83

dom manipulations:

213 - 136

269 - 34

string:

400 100

120 122

410 16

230 66

Ok, the tests they provide are used to test those things that are supposed to
get faster, so it's reasonable to believe it will, but the results are pretty
good none the less.

(I ran the tests multiple times in both browsers to get the average)

------
jrockway
I have been using chrome.jit for a while with conkeror, which leans on the
Javascript engine quite hard. It makes it noticeably faster. Not a little
faster, but "holy shit, that was fast" faster. Back when JIT was first shipped
in a release build, I enabled it on my eeepc, but not my more-powerful 64-bit
desktop (since there was no JIT for x86_64 at that time). The interface was
much faster on the eee than on my desktop. (Pages loaded slower, of course,
because Javascript was not the bottleneck. But the UI was much faster.)

Anyway, this is great news. Who ever thought back in 1995 that their glorified
blink-tag-scripting-language would be compiled to native code? :)

------
barrkel
One item that, uh, confused me:

> _First, we noticed that a large fraction of the [GC] pause time was spent
> calling free to reclaim the unused memory._

How about actually implementing a garbage collector? You know, the kind that
doesn't have to go around freeing memory?

(I'm being somewhat facetious, as retrofitting a precise compacting GC into a
codebase not set up for it isn't trivial, but it is the right direction to
move in if you actually want decent GC performance.)

------
techiferous
I never noticed the supposed speed improvements of Firefox 3.5. In fact, it
was the slowest browsing experience I've had in recent years (and yes, I tried
disabling all the add-ons!). I don't have much faith that 3.6 will be
noticeably faster.

Firefox, thanks for toppling the IE monopoly, but I'll be using the faster
Google Chrome now.

------
whyenot
I installed the new Firefox a few days ago, but it feels clunky, bloated, and
slower than Chrome. What happened to the old Firefox that was so streamlined
and light on its feet? Over time, it seems to have been transformed into the
Mozilla of old. They really need to get it in gear.

------
t3rcio
It will be a competitor for Google V8?

