Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware intrinsics #23

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

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