Bug #76651 korr routines are sub-optimal for ppc64el
Submitted: 10 Apr 2015 8:28 Modified: 30 Jan 2020 13:16
Reporter: Stewart Smith Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S5 (Performance)
Version:5.7.7 OS:Linux
Assigned to: CPU Architecture:Any
Tags: power, PowerPC

[10 Apr 2015 8:28] Stewart Smith
Description:
Due to the wonderful (err... awful) heritage of the uint8korr() functions and similar, nobody has actually sat down and properly solved the problem.

Instead, we get piecemeal assumptions of byte order based on CPU architecture rather than using a configure check.

So, there is byte_order_generic_x86.h which does optimal things for x86.

Standard MySQL 5.7.7 running sysbench read-only workload will spend a lot of time in uint8korr() in skip_trailing_spaces.

How to repeat:
Run sysbench read-only on ppc64el (e.g. Ubuntu on POWER8).

Suggested fix:
I should shortly have a patch that fixes the problem.

The *bigger* job, of going and ripping out the antiquated weirdness of having uint8korr() functions rather than cpu_to_be64() style functions like everybody else is an exercise left to someone else (I don't want to spend the time on that patch if it's not going to get applied quickly, as it'd undoubtedly need updating... if the MySQL *development* git tree was public, I probably would).
[28 Jan 2020 13:58] MySQL Verification Team
Hi Stewart,

Thank you for filing this report.

I will wait for your patch, since you are OCA. Meanwhile, I will have to do some analysis of my own .....

Hope to hear from you soon ......
[30 Jan 2020 13:16] MySQL Verification Team
Hi Stewart,

First of all, let me inform you that we do not support PPC architecture. However, this does not preclude performance improvements.

What you are proposing is already implemented, so this leads to this bug being closed.

Note that in 8.0, the function skip_trailing_space() has been rewritten, no more uint8korr, just memcpy() eight bytes at a time, which should be considerably faster.

Not a bug.
[16 Mar 2020 2:54] Daniel Black
#98520 has some hope for the remaining korr implementations. Even look good on power.
[16 Mar 2020 13:12] MySQL Verification Team
Thank you Mr. Black.

That bug is already verified.