- 論壇徽章:
- 0
|
本文內(nèi)容遵從CC版權(quán)協(xié)議, 可以隨意轉(zhuǎn)載, 但必須以超鏈接形式標(biāo)明文章原始出處和作者信息及版權(quán)聲明
網(wǎng)址: http://www.penglixun.com/tech/da ... ompile_percona.html
經(jīng)過我的測試ICC在浮點運(yùn)算,線程庫和數(shù)學(xué)函數(shù)上的優(yōu)勢非常明顯,原生SSE2指令集支持、Intel自己編寫的線程庫和數(shù)學(xué)函數(shù)庫,性能沒得說。
我用同一份運(yùn)算PI值的代碼在ICC和GCC下編譯,提升比例達(dá)20%,實際在數(shù)據(jù)庫中比較同一條超級復(fù)雜的聚合SQL,ICC提升達(dá)34%。
第一步:編譯安裝libunwind
wget http://download.savannah.gnu.org ... bunwind-0.99.tar.gz
tar zxvf libunwind-0.99.tar.gz
CC=icc \
CXX=icpc \
LD=xild \
AR=xiar \
CFLAGS=”-O3 -no-prec-div -ip -xSSE2 -axSSE2″ \
CXXFLAGS=”${CFLAGS}” \
./configure && make && make install
第二布:編譯安裝tcmalloc
wget http://google-perftools.googleco ... erftools-1.6.tar.gz
tar zxvf google-perftools-1.6.tar.gz
CC=icc \
CXX=icpc \
LD=xild \
AR=xiar \
CFLAGS=”-O3 -no-prec-div -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-div -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 |
|