Details
-
Task
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
I wrote about this in January:
https://lists.launchpad.net/maria-developers/msg06693.html
http://kristiannielsen.livejournal.com/17676.html
http://kristiannielsen.livejournal.com/18168.html
Even for simple queries, profiling shows that icache misses is a major
bottleneck to performance. The total amount of code executed is larger than
the icache, and prefetch is not sufficiently effective, making the CPU spend
most of its time waiting for new instructions to be fetched and decoded.
A partial but easy-to-implement fix is to use GCC profile-guided
optimisations. Tests have shown this to significantly reduce icache misses, as
well as causing other small improvements, for a nice total speedup in
single-threaded performance.
I already have a script that generates a suitable test load, and the commands
needed to build using PGO:
https://github.com/knielsen/gen_profile_load
mkdir bld
|
cd bld
|
cmake -DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Wno-maybe-uninitialized -g -O3 --coverage" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Wno-maybe-uninitialized -g -O3 --coverage" ..
|
make
|
|
|
tests/gen_profile_load
|
|
|
cmake -DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_FLAGS_RELWITHDEBINFO="-Wno-maybe-uninitialized -g -O3 -fprofile-use -fprofile-correction" -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-Wno-maybe-uninitialized -g -O3 -fprofile-use -fprofile-correction"
|
make
|
It just needs to be integrated into the .deb build scripts (native Debian as
well as MariaDB 3rd-party repos) as well as bintar scripts.