Bug #79155 Use hardware optimized crc32 for CRC32() function.
Submitted: 6 Nov 2015 14:40 Modified: 20 Nov 2015 7:47
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[6 Nov 2015 14:40] Daniël van Eeden
Description:
InnoDB uses hardware optimized crc32, but the CRC32() SQL function doesn't seem to use it.

https://dev.mysql.com/doc/refman/5.6/en/mathematical-functions.html#function_crc32

See Item_func_crc32 in sql/item_strfunc.cc and mysys/my_crc32.c

$ git grep 'asm("crc32'
storage/innobase/ut/ut0crc32.cc:        asm("crc32b %1, %0"
storage/innobase/ut/ut0crc32.cc:        asm("crc32q %1, %0"

One of the usecases is checksumming data which is in memory (buffer pool, key buffer etc).

I couldn't easily find info on if the crc32 in the binlog use hardware assisted crc32. It does use checksum_crc32() 

How to repeat:
Check the source code for CRC32() and see if it use hardware optimized CRC32

Suggested fix:
Use hardware optimization if possible.
[20 Nov 2015 7:47] MySQL Verification Team
Hello Daniël,

Thank you for the feature request.

Thanks,
Umesh
[22 Dec 2015 5:15] Daniel Black
Patch to fix this feature request if part of https://github.com/mysql/mysql-server/pull/41