Using the Intel C++ Compiler’s Optimization Features to Improve MySQL Performance

Print Friendly, PDF & Email

Sponsored Post

Optimizing MySQL database performance, especially in heavy demand public cloud services, is a key challenge for data base administrators.

IT operations and maintenance developers have found that just by compiling the MySQL source code using the Intel C++ Compiler with its Interprocedural Optimization feature can improve database performance up to 35% compared with other compilers.

With Interprocedural Optimization (IPO), the compiler performs a multistep whole-program analysis across functions and procedures and multiple source files. This gives the compiler a complete view of the entire program so it can better implement inlining, constant propagation, dead call/function elimination, and other specialized optimizations. Such whole-program optimizations turn out to be very effective, especially with programs that contain many heavily used small and medium sized functions.

After each source file is compiled, an intermediate representation of the source code is saved as a “mock” object file. When linking all the object files, the compiler is recalled to perform many specialized optimizations over all the intermediate files and other object or library files.

The Intel C++ Compiler, part of Intel® Parallel Studio XE 2018, takes full advantage of the latest Intel processor features to generate machine code that is optimized for maximize performance. This includes specialized optimizations targeted at the new SIMD instructions and cache structure of the latest Intel CPUs.

Besides Interprocedural Optimization, Intel compilers are capable of performing automatic vectorization to take advantage of the advanced vector instructions in the latest processors. Without requiring any changes to the source code, the compiler’s vectorizer can detect sequential operations that can be performed as vector operations in parallel. The compiler’s profile-guided optimization features use runtime profiling data to identify hot spots and bottlenecks and suggest source code changes that can improve further optimizations.

While there may be many factors affecting MySQL performance, such as hardware and software configuration, having a thoroughly optimized MySQL package is a good place to start.

Learn More about Intel C++ Compliers


  1. David Yeager says

    Most of this speedup on MySQL with ICC comes from profile guided optimizations. You can get similar speedup by using LLVM or GCC with profile guided optimizations, or with Dynimize, a JIT compiler which performs similar optimizations at runtime.