axlrose 发表于 2012-09-06 10:16

[转]Clang'ed FreeBSD: Builds Quicker, Uses Way Less RAM

原文出处:http://www.phoronix.com/scan.php?page=news_item&px=MTE3NjI
Clang'ed FreeBSD: Builds Quicker, Uses Way Less RAM
Posted by Michael Larabel on September 05, 2012
A FreeBSD developer has carried out a series of performance tests to explore the impact that LLVM/Clang as the default FreeBSD compiler has on FreeBSD 10 in its current form. The Clang compiler performance was compared to GCC 4.2.1 and GCC 4.7.1. Clang mostly comes out ahead of GCC on FreeBSD.

With the yet-to-be-released FreeBSD 10, Clang is the default compiler with GCC being deprecated from this popular BSD operating system. The simple conclusion from Dimitry Andric that did the compiler testing on FreeBSD 10.0-CURRENT is that Clang compiles mostly faster than GCC (sometimes by a wide margin) and that Clang uses "significantly less" memory during the compilation process.

This testing was looking at the compilation speed as opposed to the speed of the result binaries, which is where Phoronix compiler benchmarks are mostly focused on.

Below are the key remarks from Dimitry's FreeBSD 10 amd64 compiler testing between GCC and LLVM/Clang.

    Summary:
    --------
    For building this specific large C++ program, gcc 4.2.1 is ~86% slower than clang 3.1 in real time, ~82% slower in user time, and ~176% slower in system time. The maximum resident set size during building is ~217% larger, and it causes ~279% more page reclaims.

    Though gcc 4.7.1 is faster than its older version, it is still ~68% slower than clang 3.1 in real time, ~64% slower in user time, and ~161% slower in system time. The maximum resident set size during building is ~220% larger, and it causes ~208% more page reclaims.

    Finally, clang 3.2 is ~3% slower than clang 3.1 in both real time and user time, and ~2% slower in system time. The maximum resident set size and the number of page reclaims during building are approximately equal.

    Conclusion:
    -----------
    Clang 3.1 is clearly the fastest compiler for building this specific large C++ program, with clang 3.2 trailing closely behind. Both are significantly faster, and use much less memory than either version of gcc.

So the Clang C/C++ compiler is doing very good in the FreeBSD world for building packages faster while using less memory. The only negative news towards Clang from these results is that the currently-in-development LLVM 3.2 is slightly slower than LLVM 3.1, but hopefully the build-time performance regressions can be worked out prior to the official 3.2 release and isn't becoming a trend of Clang slowing down as more functionality is introduced into the Apple-sponsored compiler.

The compiler testing data in full is available from this mailing list post.
打算过段时间在虚拟机上体验下FreeBSD 10-Current

lsstarboy 发表于 2012-09-06 14:44

有人测试过编译后程序的运行速度吗?

ahocat 发表于 2012-09-07 11:04

编译得快是一方面,更重要的是编译出来的东西跑得快不快。

egmkang 发表于 2012-09-07 12:56

本帖最后由 egmkang 于 2012-09-07 13:02 编辑

ahocat 发表于 2012-09-07 11:04 static/image/common/back.gif
编译得快是一方面,更重要的是编译出来的东西跑得快不快。

还好啊

我自己写的demo, lock free的message queue,clang 3.1 + libc++比gcc 4.6.3 + libstdc++速度快一倍以上

axlrose 发表于 2012-09-07 14:29

经常看到 http://www.phoronix.com/ 有测试,不知道是如何测试的

Hongqiyaodao 发表于 2012-09-07 18:29

beyondfly 发表于 2012-09-07 19:46

这个玩意,看起来不错
页: [1]
查看完整版本: [转]Clang'ed FreeBSD: Builds Quicker, Uses Way Less RAM