2013年2月2日 星期六

Firefox 18 vs. Chrome 24

我們的產品以網頁為人機界面。這些日子我最關心的事情之一就是 Firefox 在 javascript performance 上的性能提升。雖然 Chrome 的性能已經滿足產品的需求,我仍希望 Chrome 不是唯一的選擇。畢竟,Firefox 在客製化的能力上略勝一籌。

Firefox 18 採用 IonMonkey 為引擎,首次使得我們的產品能在 Firefox 上使用。雖然切換畫面時,仍有延遲,已是很大的進步。

Google 在去年八月提出新的 javascript 速度評估的基準 octane。經瞭解,他的基準包括了以下幾項新的測試:
  • Box2DWeb
  • Mandreel
  • Pdf.js
  • GB emulator
  • CodeLoad
其中的 Box2DWeb 測試 2D 繪圖能力。Mandreel 測試 3D 繪圖能力。這兩項對我未來的產品都很重要。

Octane 的連結位於:
http://octane-benchmark.googlecode.com/svn/latest/index.html
只要點選以上連結,就可以進行測試。

以下是使用我的筆電針對 octane v1 測試的結果:
測試測試內容Chrome 24Firefox 18
RichardsCore language features104748991
DeltablueCore language features1381211333
CryptoBit and math operations114859111
RaytraceCore language features146826701
EarlyBoyerMemory and GC2367912388
RegexpStrings and Arrays3061922
SplayMemory and GC435510431
NavierStokesStrings and Arrays1501715418
pdf.jsStrings and Arrays102373913
MandreelVirtual machine101546803
GB emulatorVirtual machine111116212
CodeLoadLoading and Parsing104448634
Box2DWebBit and math operations116677325

可以看出 Firefox 18 和 Chrome 24 仍有很大差距。

不過,Mozilla 的團隊每日比較 Firefox 和 Chrome 的性能(http://arewefastyet.com/), 從 2012 年十二月到 2013 年二月初,可以見到 Firefox 一路迫進 Chrome 的性能。該說唉呀已經達到  Chrome 的 90% 的速度了。想來,我的產品上切換畫面的延遲可能已得到解決,只是還得等到 Firefox 19,20。但是,是不是有可能更好,進而和 Chrome 平手?

似乎是可能的。Firefox 的 Generational GC 尚未完成。它的完成將帶來 Firefox 性能的再次提升。