[cfe-dev] Clang build of PostgreSQL

Sean McBride sean at rogue-research.com
Thu Jun 23 13:47:31 PDT 2011


On Thu, 23 Jun 2011 21:21:42 +0100, Peter Geoghegan said:

>I work on the PostgreSQL project, and was present at Chris Lattner's
>talk on Clang/LLVM at FOSDEM earlier in the year. At that talk,
>Postgres was specifically cited as an example of a medium sized C
>program that had seen large improvements in compile times when built
>with Clang. Here are his slides:
>
>http://www.scribd.com/doc/48921683/LLVM-Clang-Advancing-Compiler-Technology
>
>I would really like to be able to reproduce some of Chris's work here,
>to demonstrate to the PostgreSQL community.
>
>Here is an example of arguments given to Clang (and gcc) by PG's build system:
>
>/home/peter/build/Release/bin/clang -O2 -Wall -Wmissing-prototypes
>-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
>-Wformat-security -fno-strict-aliasing -fwrapv -I../../../src/include
>-D_GNU_SOURCE   -c -o pg_db_role_setting.o pg_db_role_setting.c
>
>At present, when I build Postgres using gcc (specifically, Fedora's
>build of gcc 4.6), I see a build time of 2 minutes 1 second. For
>Clang, built today from SVN tip, I see a build time of 3m23s. Clang
>has been built with --enable-optimized and --disable-assertions in an
>attempt to be objective.

Those numbers are for gcc 4.2, and probably Apple's fork thereof.  One would assume the gcc folks have made improvements in 4.6, which you used.

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada






More information about the cfe-dev mailing list