clang编译 PostgreSQL

less than 1 minute read

背景

实际测试clang 3.7.1比gcc 4.9.3编译的PostgreSQL性能略好。

测试数据参考下文末尾

《BenchmarkSQL 测试PostgreSQL 9.5.0 TPC-C 性能》

gcc安装

《gcc 更新》

llvm, clang安装

《llvm, clang》

CC=/u02/dege.zzz/llvm/bin/clang CFLAGS="-O2 -fstrict-enums" ./configure --prefix=/u02/digoal/soft_bak/pgsql9.5  --with-pgport=1921 --with-perl --with-python --with-tcl --with-openssl --with-pam --with-ldap --with-libxml --with-libxslt --enable-thread-safety  
make world -j 32  
make install-world -j 32  

参考

http://www.kitware.com/blog/home/post/1016

http://grokbase.com/t/postgresql/pgsql-hackers/10bggd42rt/gcc-vs-clang

http://llvm.org/releases/download.html

http://www.tuicool.com/articles/Yz2Q7nz

Flag Counter

digoal’s 大量PostgreSQL文章入口