Developers › Desktop Team blog

JavaScript Performance with new Mac compiler

September 28, 2011 · by Daniel Aleksandersen

We thought some of you might be interested in the performance gains we saw internally when upgrading from Xcode 3.2 / GCC 4.0 to Xcode 4.1 / GCC 4.2 and our build system from OS 10.6 to OS X Lion. Here is a snapshot of the performance gains on Mac OS:


Performance increase when upgrading compiler:
  • Dromaeo DOM +2.93%
  • Kraken 1.1 +2.48%
  • V8 v6 +2.14%
  • Sunspider 0.9.1 +1.85%
  • Dromaeo JavaScript +0.67%

Total performance increase since 11.51:
  • Dromaeo DOM +3.58%
  • Kraken 1.1 +6.68%
  • V8 v6 +5.32%
  • Sunspider 0.9.1 -5.28%†
  • Dromaeo JavaScript +1.33%

Test hardware: iMac12,1; OS X 10.6.8; i5 2.5 GHz; 4 GB

† Regression not related to the compiler change. Yes, we are investigating it. DSK-346475

Readers' comments

Comments left by My Opera members under the original post: the first 10, as archived.

  • Charlie ClarkMuzzlehatchWednesday, September 28, 2011 12:39:07 PM

    Interesting numbers showing how important the plumbing is.
  • Lương Thế Minh QuangquangltmWednesday, September 28, 2011 12:54:08 PM

    smile
  • Gábor LehelIllissiusWednesday, September 28, 2011 2:02:32 PM

    GCC 4.2 is still pretty dang old. Is there a reason to be this far behind the curve? Especially given that the performance win from switching to a faster compiler is basically "free". From what I remember seeing in compiler benchmarks at Phoronix, GCC 4.6 in particular offers a nice boost over previous versions.
  • JimtoyotabedzrockWednesday, September 28, 2011 3:52:06 PM

    What about LLVM?

    I'd still recommend the Intel Compiler, it works on Win, Mac, Linux and can emulate compatibility with GCC.
  • tomhiggyWednesday, September 28, 2011 6:20:03 PM

    Isn't the Intel Compiler reported to produce slower builds for AMD based machines by not using some AMD specific codepaths? Would rather see it built with a 'neutral' compiler than one which favours one chipset over another. Alternatively, perhaps multiple builds could be offered in an 'unofficial' repository?

    Edit: out of interest, which compiler is used for the Linux builds and what are the compiler flags used for these?
  • Rianav AntaresKerenSkyyWednesday, September 28, 2011 7:02:51 PM

    Originally posted by Illissius:

    GCC 4.2 is still pretty dang old. Is there a reason to be this far behind the curve? Especially given that the performance win from switching to a faster compiler is basically "free". From what I remember seeing in compiler benchmarks at Phoronix, GCC 4.6 in particular offers a nice boost over previous versions.



    Could be the license change gplv3 vs gplv2 iirc. freebsd uses 4.2 max as well and they are strange about the lic. terms.
  • RomainGeisslerWednesday, September 28, 2011 8:05:23 PM

    In fact, you already use LLVM. With the last version of Xcode, /usr/bin/gcc is in fact llvmgcc42 (as given by "gcc -v" ran in a terminal). GCC is used only as a frontend (i.e.: it only does all the parsing stuff, all the art of compilation such as code optimization and generation is made by LLVM).

    You should try comparing performances between your actual build with LLVM and GCC 4.6 (that you must build by yourself, but not with LLVM as the version shipped with XCode is buggy and cannot build GCC 4.6, use /usr/bin/gcc-4.2 instead that is a real complete GCC compiler (different from /usr/bin/gcc))
  • Cutting SpoonhellsporkThursday, September 29, 2011 12:46:32 AM

    Originally posted by tomhiggy:

    Isn't the Intel Compiler reported to produce slower builds for AMD based machines by not using some AMD specific codepaths?


    Not since an agreement with a US regulatory body (FTC I think...?); they were cornered and threatened with being forced to establish a recompilation fund if they fail to comply.
  • Witold BarylukmovaxFriday, September 30, 2011 4:49:29 AM

    Nice improvement.

    GCC 4.6 should give even better results. Especially if you will use LTO (Link Time Optimization), which will allow much more aggressive global and interprocedural optimizations, this also includes shrinking resulting binary size considerably. PGO (Profile guided optimization) also helps LTO by making even smarter decision (for example about inliening).

    Would be nice to try, at least under Linux.
  • JimtoyotabedzrockSaturday, October 1, 2011 12:34:08 AM

    Originally posted by tomhiggy:

    Isn't the Intel Compiler reported to produce slower builds for AMD based machines by not using some AMD specific codepaths? Would rather see it built with a 'neutral' compiler than one which favours one chipset over another. Alternatively, perhaps multiple builds could be offered in an 'unofficial' repository?



    They fixed that when they got called out for it, it should be faster for both.

About this article

Published inDesktop Team blog
DateSeptember 28, 2011
AuthorDaniel Aleksandersen
Tagsperformance mac javascript
OriginalInternet Archive