Skip to content

Conversation

EduardSergeev
Copy link

@EduardSergeev EduardSergeev commented Aug 27, 2023

Latest .NET frameworks have better support for hardware-accelerated CRC32 implementations:

  • CRC32C polynomial:
    • Intel CPUs supporting SSE4.2
    • ARM CPUs since ARMv8.1
  • CRC32 polynomial:
    • ARM CPUs since ARMv8.1

Note: Arm does support both CRC32 and CRC32C (since ARMv8.1) as does System.Runtime.Intrinsics.Arm (since .NET 5): CRC32 and CRC32C.

Test results (.NET 7):

  • Intel (Linux Mint 21.2, 11th Gen Intel Core i7-1165G7 2.80GHz CPU):
    Crc32.Crc32Algorithm Throughput: 435.0 MB/s
    K4os.Hash.Crc Throughput: 434.5 MB/s
    Crc32C.Standard Throughput: 1379.8 MB/s
    Force.Crc32.Crc32CAlgorithm Throughput: 1822.1 MB/s
    Force.Crc32.Crc32Algorithm Throughput: 1724.3 MB/s
    Force.Crc32.Intrinsics.Crc32CAlgorithm Throughput: 11116.4 MB/s
    
  • Arm (Amazon Linux 2, AWS c7g.large EC2: AWS Graviton3 CPU):
    Crc32.Crc32Algorithm Throughput: 352.8 MB/s
    K4os.Hash.Crc Throughput: 309.6 MB/s
    Crc32C.Standard Throughput: 1113.0 MB/s
    Force.Crc32.Crc32CAlgorithm Throughput: 1692.4 MB/s
    Force.Crc32.Crc32Algorithm Throughput: 1694.0 MB/s
    Force.Crc32.Intrinsics.Crc32CAlgorithm Throughput: 3278.2 MB/s
    Force.Crc32.Intrinsics.Crc32Algorithm Throughput: 3293.3 MB/s
    

Fixes #16

- Force.Crc32.Intrinsics.Crc32Algorithm - CRC32 (supported by ARM)
- Force.Crc32.Intrinsics.Crc32CAlgorithm - CRC32A (supported by Intel and ARM)
Add unit and performance tests for intrinsics implementations
Update performance tests to use latest dependencies
Run performance tests on all supported platforms
Remove no longer supported frameworks
Use latest supported .NET frameworks:
- .NET 6
- .NET 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Crc32C Hardware Intrinsics on .NET Core 3
1 participant