当前位置:首页 > PHP教程 > PHP总结归纳

ICC静态编译Percona

本文内容遵从cc版权协议, 可以随意转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明网址: http://www.penglixun.com/tech/database/icc_static_compile_percona.html

经过我的测试icc在浮点运算,线程库和数学函数上的优势非常明显,原生sse2指令集支持、intel自己编写的线程库和数学函数库,性能没得说。
我用同一份运算pi值的代码在icc和gcc下编译,提升比例达20%,实际在数据库中比较同一条超级复杂的聚合sql,icc提升达34%。

第一步:编译安装libunwind
wget http://download.savannah.gnu.org/releases/libunwind/libunwind-0.99.tar.gz
tar zxvf libunwind-0.99.tar.gz

cc=icc
cxx=icpc
ld=xild
ar=xiar
cflags=”-o3 -no-prec-p -ip -xsse2 -axsse2″
cxxflags=”${cflags}”
./configure && make && make install

第二布:编译安装tcmalloc
wget http://google-perftools.googlecode.com/files/google-perftools-1.6.tar.gz
tar zxvf google-perftools-1.6.tar.gz

cc=icc
cxx=icpc
ld=xild
ar=xiar
cflags=”-o3 -no-prec-p -ip -xsse2 -axsse2″
cxxflags=”${cflags}”
./configure –disable-debugalloc –enable-frame-pointers && make && make install

echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig

第三部:编译安装percona
cc=icc
cxx=icpc
ld=xild
ar=xiar
cflags=”-o3 -unroll2 -ip -mp -restrict -fno-exceptions -fno-rtti -no-prec-p -fno-implicit-templates -static-intel -static-libgcc -xsse2 -axsse2″
cxxflags=”${cflags}”
cppflags=” -i/usr/alibaba/icc/include ”
ldflags=” -l/usr/alibaba/icc/lib -lrt ”
./configure –prefix=/usr/alibaba/install/percona-custom-5.1.53-12.4
–with-server-suffix=-alibaba-edition
–with-mysqld-user=mysql
–with-plugins=heap,innodb_plugin,myisam,partition
–with-charset=utf8
–with-collation=utf8_general_ci
–with-extra-charsets=gbk,utf8,ascii
–with-big-tables
–with-fast-mutexes
–with-zlib-dir=bundled
–with-readline
–with-pthread
–with-mysqld-ldflags=’-all-static -ltcmalloc’
–enable-assembler
–enable-profiling
–enable-local-infile
–enable-thread-safe-client
–without-embedded-server
–with-client-ldflags=-all-static
–with-mysqld-ldflags=-all-static
–with-mysqld-ldflags=-ltcmalloc
–without-query-cache
–without-geometry
–without-debug
–without-ndb-binlog
–without-ndb-debug
编译完成后make && make install

.syntaxhighlighter{padding-top:20px;padding-bottom:20px;}
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!