RFR: 8277358: Accelerate CRC32-C [v2]

Scott Gibbons duke at openjdk.java.net
Wed Dec 1 01:44:31 UTC 2021


On Wed, 1 Dec 2021 00:02:14 GMT, Scott Gibbons <duke at openjdk.java.net> wrote:

>> Accelerates CRC32-C by utilizing vpclmulqdq similarly to CRC32.  This change achieves ~4x throughput improvement.
>> 
>> 5986.947899319073 MB/s => 24041.05203089616 MB/s
>> 5840.02689336947 MB/s => 24898.781468710356 MB/s
>> 
>> ********** Original ***********
>> 
>> 
>> scottgi at 96974-ICX32:~/crc/jdk (asgibbons-crc32c)$ java test/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32C.java 20000000
>>  offset = 0
>> msgSize = 512 bytes
>>   iters = 20000000
>> -------------------------------------------------------
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> CRC32C.update(byte[]) runtime = 1.710387358 seconds
>> CRC32C.update(byte[]) throughput = 5986.947899319073 MB/s
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> -------------------------------------------------------
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> CRC32C.update(ByteBuffer) runtime = 1.753416583 seconds
>> CRC32C.update(ByteBuffer) throughput = 5840.02689336947 MB/s
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> -------------------------------------------------------
>> 
>> 
>> 
>> 
>> *********** With my changes: *************
>> 
>> 
>> 
>> scottgi at 96974-ICX32:~/crc/jdk (asgibbons-crc32c)$ java test/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32C.java 20000000
>>  offset = 0
>> msgSize = 512 bytes
>>   iters = 20000000
>> -------------------------------------------------------
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> CRC32C.update(byte[]) runtime = 0.425938099 seconds
>> CRC32C.update(byte[]) throughput = 24041.05203089616 MB/s
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> -------------------------------------------------------
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> CRC32C.update(ByteBuffer) runtime = 0.411265106 seconds
>> CRC32C.update(ByteBuffer) throughput = 24898.781468710356 MB/s
>> CRCs: crc = ae10ee5a, crcReference = ae10ee5a
>> -------------------------------------------------------
>
> Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Adding CRC32-C microbenchmark.

Benchmark results:


Benchmark                    (count)  Mode  Cnt  Score    Error  Units
TestCRC32C.testCRC32CUpdate       64  avgt    6  0.021 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate      128  avgt    6  0.031 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate      256  avgt    6  0.023 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate      512  avgt    6  0.026 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate     1024  avgt    6  0.035 ±  0.002  us/op
TestCRC32C.testCRC32CUpdate     2048  avgt    6  0.052 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate     4096  avgt    6  0.092 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate     8192  avgt    6  0.174 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate    16384  avgt    6  0.337 ±  0.001  us/op
TestCRC32C.testCRC32CUpdate    32768  avgt    6  0.663 ±  0.002  us/op
TestCRC32C.testCRC32CUpdate    65536  avgt    6  1.317 ±  0.004  us/op
Finished running test 'micro:java.util.TestCRC32C'

-------------

PR: https://git.openjdk.java.net/jdk/pull/6595


More information about the hotspot-dev mailing list