BOLT优化方法

  1. 使用BOLT构建插桩版MySQL,生成插桩的二进制mysqld.inst。

    1
    llvm-bolt $SHELL_PATH/install/bin/mysqld -instrument -o mysqld.inst -instrumentation-file=mysqld.fdata --instrumentation-wait-forks -instrumentation-sleep-time=2 -instrumentation-no-counters-clear --instrumentation-binpath=$SHELL_PATH/install/bin/mysqld.inst  # mysqld.fdata为profile文件的指定目录
    

  2. 使用插桩后的二进制 mysqld.inst运行典型的benchmark,如sysbench、TPCC。运行结束、退出mysql后,会生成名为mysqld.fdata的 profile文件。
  3. 结合采集的profile文件,生成高性能的mysql 二进制mysqld.opt。

    1
    llvm-bolt $SHELL_PATH/install/bin/mysqld -o mysqld.opt -data=mysqld.fdata --infer-fall-throughs --reorder-blocks=ext-tsp --reorder-functions=hfsort --peepholes=useless-branches --simplify-conditional-tail-calls --simplify-rodata-loads --indirect-call-promotion-use-mispredicts --elim-link-veneers --eliminate-unreachable --fix-block-counts --fix-func-counts --split-all-cold --sctc-mode=preserve --align-blocks --cg-use-split-hot-size --tail-duplication=aggressive --iterative-guess --assume-abi