Details
-
Type:
Task
-
Status: Stalled
-
Priority:
Major
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: None
-
Labels:
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.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Hm, I have a patch for using PGO when building .debs.
But I did a quick test with a bunch of simple queries, and the PGO binaries were not seen to be faster. In fact, they were seen to be a few percent slower.
So I need to analyse this before proceeding, need to find the explanation for this, to see if the PGO idea is at all viable.