Description:
Using CRC32 ARM intrinsic calls to calculate the checksum.
There are 2 types of checksum: crc32, crc32c.
- crc32 is traditional crc32 found in most of the zip utilities.
- crc32c (crc32 Castagnoli) uses different polynomial and a new generation
the platform can compute full 32 bit crc32c in 3 cycles.
- MySQL uses both of them. crc32 is used for calculating table and binlog
checksum and crc32c for by InnoDB for page-checksum.
- ARM ACLE added intrinsic support for both crc32 variants.
(As per my reading I haven't seen the support for crc32 on x86-sse.
x86-sse has crc32c support).
- Currently, MySQL calculates crc32 using zlib (software-based approach).
Said patch help optimize use of crc32 (on ARM) by leveraging the
corresponding ARM ACLE supported crc32 variants (crc32[b|h|w|d]).
-----------------------------------------------------------------
Approach help reduces checksum time for the table.
Our local testing revealed gain upto 50% (reduction in time)
in mil table-checksum timing in sec
table-size w/o patch w/ patch %reduction
0.1 0.15 0.06 60
1 1.5 0.69 54
5 7.55 3.55 53
10 14.94 6.92 54
50 75.25 34.5 54
-----------------------------------------------------------------
You can also access the patch here for easy accessibility.
(physical copy attached below with OCA confirmation)
https://github.com/mysqlonarm/mysql-server/commit/b31ba89c3141ee0741037c0c1638227f88b79e21
-----------------------------------------------------------------
Is testing done?
* checksum performance testing .. gain observed.
* general performance testing (on ARM) .. no regression observed
* mtr testing on ARM and x86.. done (patch doesn't change approach for x86)
How to repeat:
* Patch is created against mysql-8.0.19 tag.
* Apply the patch and load any table.
* Execute table checksum (checksum table <table-name>)
* Try the same w/o patch.
* You will observe a significant difference in checksum timing.
[In our local testing on ARM we have observed timing reduced up to 50%].
Suggested fix:
* Apply the patch to use ARM crc32 intrinsic.
Description: Using CRC32 ARM intrinsic calls to calculate the checksum. There are 2 types of checksum: crc32, crc32c. - crc32 is traditional crc32 found in most of the zip utilities. - crc32c (crc32 Castagnoli) uses different polynomial and a new generation the platform can compute full 32 bit crc32c in 3 cycles. - MySQL uses both of them. crc32 is used for calculating table and binlog checksum and crc32c for by InnoDB for page-checksum. - ARM ACLE added intrinsic support for both crc32 variants. (As per my reading I haven't seen the support for crc32 on x86-sse. x86-sse has crc32c support). - Currently, MySQL calculates crc32 using zlib (software-based approach). Said patch help optimize use of crc32 (on ARM) by leveraging the corresponding ARM ACLE supported crc32 variants (crc32[b|h|w|d]). ----------------------------------------------------------------- Approach help reduces checksum time for the table. Our local testing revealed gain upto 50% (reduction in time) in mil table-checksum timing in sec table-size w/o patch w/ patch %reduction 0.1 0.15 0.06 60 1 1.5 0.69 54 5 7.55 3.55 53 10 14.94 6.92 54 50 75.25 34.5 54 ----------------------------------------------------------------- You can also access the patch here for easy accessibility. (physical copy attached below with OCA confirmation) https://github.com/mysqlonarm/mysql-server/commit/b31ba89c3141ee0741037c0c1638227f88b79e21 ----------------------------------------------------------------- Is testing done? * checksum performance testing .. gain observed. * general performance testing (on ARM) .. no regression observed * mtr testing on ARM and x86.. done (patch doesn't change approach for x86) How to repeat: * Patch is created against mysql-8.0.19 tag. * Apply the patch and load any table. * Execute table checksum (checksum table <table-name>) * Try the same w/o patch. * You will observe a significant difference in checksum timing. [In our local testing on ARM we have observed timing reduced up to 50%]. Suggested fix: * Apply the patch to use ARM crc32 intrinsic.