[MacPorts] #45308: clang-3.4 unexplicably slow

MacPorts noreply at macports.org
Thu Oct 9 06:33:47 PDT 2014


#45308: clang-3.4 unexplicably slow
--------------------------+--------------------------------
  Reporter:  rjvbertin@…  |      Owner:  macports-tickets@…
      Type:  defect       |     Status:  closed
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:  2.3.1
Resolution:  worksforme   |   Keywords:
      Port:  clang-3.4    |
--------------------------+--------------------------------

Comment (by rjvbertin@…):

 From the thread on MacPorts-Users , called "clang's build performance"

 {{{
 port clean rekonq ; time port -v destroot rekonq # uses Apple's gcc-4.2 on
 OS X 10.6.8
 2:59 total_time
 port clean rekonq ; time port -v destroot rekonq configure.compiler=clang
 # uses Apple's clang-3.0 on OS X 10.6.8
 1:42 total_time
 port clean rekonq ; time port -v destroot rekonq configure.compiler
 =macports-clang-3.4
 4:04 total_time
 port clean rekonq ; time port -v destroot rekonq configure.compiler
 =macports-gcc-4.8
 2:22 total_time

 A comparable comparison on my Linux netbook (dual core AMD C60 cpu;
 `debian/rules clean ; time debian/rules install` in the Ubuntu 14.04
 rekonq package source).
 Using gcc-4.8:
 669.665 user_cpu 55.457 kernel_cpu 19:34.14 total_time 61.7%CPU {0W 0X 0D
 0K 181844M 23F 4669330R 3615500I 544928O 0r 0s 0k 65267w 773771c}
 Using clang 3.4:
 595.714 user_cpu 44.989 kernel_cpu 16:43.17 total_time 63.8%CPU {0W 0X 0D
 0K 110304M 314F 3911531R 2632925I 239908O 0r 0s 0k 78230w 570316c}
 }}}

 {{{
 I cannot answer why, but I can confirm what you have seen. Even on
 OSX10.9, where the system clang is

 MacBookPro ~ > clang -v
 Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
 Target: x86_64-apple-darwin13.3.0
 Thread model: posix

 So I would guess closer to MacPorts clang 3.4 than it is on OSX10.6, build
 with the system clang is significantly faster than MacPorts…
 }}}

 {{{
 I have also observed the regression in compilation speed.  Which
 is not really surprising: GCC was slower, but producing better
 code (at least on my project).  Now clang is catching up on
 the quality of the produced code, but that does require more
 compilation time.
 }}}

 So even on the same machine running the same operating system (10.9.x),
 clang-mp-3.4 is slower than Apple's 3.4-based clang. To me that reeks more
 of a difference the way the compiler is built than as a bug in llvm ...
 If clang weren't faster than gcc on Linux I'd almost think Apple were
 keeping a performance tweak for their own version.

 This remind me a bit of the situation with gcc in the PowerPC days, where
 the same gcc version was very noticeably slower on OS X on a PPC machine
 that was otherwise considerably faster than the i386 Linux hosts I had
 access to at the time. (This wasn't just with Apple-provided gcc versions,
 but also with a self-built gcc 4.0.x built with full optimisation flags.)

-- 
Ticket URL: <https://trac.macports.org/ticket/45308#comment:2>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list