JavaScript Performance on GTK Linux Browsers
I've recently noticed that my system is sluggish on certain web pages which incorporates lots of behavior with JavaScript. I've been running Iceweasel from Debian's testing repositories for ages. I had heard some mentions of lower memory usage and faster JavaScript in the upcoming 3.0 release of Firefox®/Iceweasel throughout the blogosphere. In addition the developers of Epiphany have recently decided to use WebKit as their default backend.
I desperately needed better JavaScript performance and decided to test the stable 2.0 branch of Iceweasel against the latest beta version from the 3.0 branch together with the latest WebKit enabled Epiphany from the Debian unstable repositories. Why not test Opera? Firstly Opera is Qt and not GTK based -- a showstopper for me. Secondly Opera is not open source software. Thirdly Opera does not natively run on the x86-64 architecture. Therefore the browser versions used for testing were as follows (identified by their user User-Agent request header):
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.14) Gecko/20080404
Iceweasel/2.0.0.14 (Debian-2.0.0.14-2)
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b5) Gecko/2008032602
Iceweasel/3.0b5 (Debian-3.0~b5-2)
Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/525.1+ (KHTML, like
Gecko, Safari/525.1+) epiphany-browser
And here are their Debian package versions:
# apt-cache show iceweasel
Package: iceweasel
Architecture: amd64
Version: 2.0.0.14-2
# apt-cache show iceweasel
Package: iceweasel
Architecture: amd64
Version: 3.0~b5-2
# apt-cache show epiphany-webkit
Package: epiphany-webkit
Architecture: amd64
Version: 2.22.1.1-2
Based on those User-Agent strings it should be no surprise that I'm running a x86-64 based system on Debian. Here are more specific details of my system:
# cat /etc/issue
Debian GNU/Linux lenny/sid
# uname -a
Linux diamond 2.6.24-1-amd64 #1 SMP Mon Feb 11 13:47:43 UTC 2008
x86_64 GNU/Linux
# cat /proc/cpuinfo
processor : 0
model name : AMD Athlon(tm) X2 Dual Core Processor BE-2300
cpu MHz : 1903.970
cache size : 512 KB
bogomips : 3811.20
processor : 1
model name : AMD Athlon(tm) X2 Dual Core Processor BE-2300
cpu MHz : 1903.970
cache size : 512 KB
bogomips : 3807.96
# cat /proc/meminfo
MemTotal: 963952 kB
SwapTotal: 498004 kB
I decided to use John Resig's Dromaeo and WebKit's SunSpider JavaScript performance test suites to benchmark the performance of the selected browsers against each other. Remember the wise words of Benjamin Disraeli:
There are three kinds of lies: lies, damned lies, and statistics.
The performance metrics presented here applies for my system, and my system alone. There could be a myriad of factors contributing to the numbers I received. To keep such factors to a minimum I rebooted my system before staring the browser under testing, and then restarted my system again before testing the next browser. In addition I blasted away any profiles, running the browsers vanilla without any cache, history, cookies, nor extensions.
I started writing a script with Hpricot and ghcartrb to generate some nice detailed charts of the differences between the browsers. But when I found myself writing code like this:
max = parsed.map {|res| res.values[0]}.transpose.map do |val|
val.inject(0) { |sum,x| sum+x }
end.max
I threw in the towel and decided to make some manual summarization charts. Without further ado, here are the results for the respective browsers:
For detailed differences between the browsers have a look at:
- Comparison between all three browsers for the Dromaeo suite.
- Results of Iceweasel 2.0, Iceweasel 3.0, and Epiphany for the SunSpider suite.
Based on these observations it's not hard to see that there have been major improvements from the 2.0 releases to the forthcoming 3.0 release of Iceweasel with regards to JavaScript performance. The WebKit enabled Epiphany browser is on par with Iceweasel 3.0 in the Dromaeo test suite while it seems to be marginally faster than Iceweasel 3.0 in the SunSpider test suite.
The differences between Iceweasel 3.0 and Epiphany does not seem to be
sufficient for switching. Epiphany does seem to be a bit more light weight
and is delivering everything I need in a browser. The only thing holding me
back is the Vimperator extension for Iceweasel. I simply can't live
without vi
keybindings in my browser now that I've gotten used to it.
I'll adopt the 3.0 branch of Iceweasel if it proves to be stable over some
more prolonged use.