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

64-bit ARM support #29

Merged
merged 12 commits into from
Aug 26, 2024
Merged

64-bit ARM support #29

merged 12 commits into from
Aug 26, 2024

Conversation

lemire
Copy link
Member

@lemire lemire commented Aug 22, 2024

We might need to use .NET 9.0 (which is freely available in preview form).

On an Apple M2 (ARM), we are about 50% faster than the accelerated .NET functions. And twice as fast as the UTF-8 function.

After merging this PR, one needs to install https://dotnet.microsoft.com/en-us/download/dotnet/9.0

|                                       Method |                    FileName |        Mean |       Error |    StdDev | Speed (GB/s) |
|--------------------------------------------- |---------------------------- |------------:|------------:|----------:|------------- |
|                      ARMDecodingRealDataUTF8 | data/dns/swedenzonebase.txt | 11,346.6 us |   100.66 us |  26.14 us |         3.09 |
|             ARMDecodingRealDataWithAllocUTF8 | data/dns/swedenzonebase.txt | 16,834.0 us |   314.17 us |  48.62 us |         2.09 |
|                     ARMDecodingRealDataUTF16 | data/dns/swedenzonebase.txt | 15,668.2 us |   164.77 us |  25.50 us |         2.24 |
|                      ARMDecodingRealDataUTF8 |                 data/email/ |    320.9 us |     5.28 us |   1.37 us |         6.16 |
|             ARMDecodingRealDataWithAllocUTF8 |                 data/email/ |    399.5 us |    11.16 us |   1.73 us |         4.95 |
|                     ARMDecodingRealDataUTF16 |                 data/email/ |    360.1 us |    13.51 us |   3.51 us |         5.49 |
|          DotnetRuntimeSIMDBase64RealDataUTF8 | data/dns/swedenzonebase.txt | 14,892.6 us |   314.74 us |  81.74 us |         2.36 |
| DotnetRuntimeSIMDBase64RealDataWithAllocUTF8 | data/dns/swedenzonebase.txt | 17,210.5 us | 1,207.52 us | 186.87 us |         2.04 |
|             DotnetRuntimeBase64RealDataUTF16 | data/dns/swedenzonebase.txt | 31,863.2 us |   564.07 us | 146.49 us |         1.10 |
|          DotnetRuntimeSIMDBase64RealDataUTF8 |                 data/email/ |    512.1 us |     3.73 us |   0.97 us |         3.86 |
| DotnetRuntimeSIMDBase64RealDataWithAllocUTF8 |                 data/email/ |    585.1 us |     4.34 us |   0.67 us |         3.38 |
|             DotnetRuntimeBase64RealDataUTF16 |                 data/email/ |  1,797.4 us |   382.35 us |  99.30 us |         1.10 |

@lemire lemire changed the title Arm PR [draft] 64-bit ARM support Aug 25, 2024
@lemire lemire requested a review from Nick-Nuon August 25, 2024 02:49
@lemire
Copy link
Member Author

lemire commented Aug 25, 2024

@Nick-Nuon This can be merged at will. The results are good.

@lemire
Copy link
Member Author

lemire commented Aug 25, 2024

There is a minor issue, it seems, with UTF-16... investigating.

@lemire
Copy link
Member Author

lemire commented Aug 25, 2024

@Nick-Nuon Ok. It should be good now. I have also added some new namespaces and a new file (Base64.cs), please have a look.

@Nick-Nuon
Copy link
Collaborator

@Nick-Nuon Ok. It should be good now. I have also added some new namespaces and a new file (Base64.cs), please have a look.

OK cool. Taking a look at it right now.

@lemire
Copy link
Member Author

lemire commented Aug 25, 2024

OK cool. Taking a look at it right now.

Splitting things up should make it easier to extend to AVX2 and AVX-512 without getting confused. :-)

@lemire
Copy link
Member Author

lemire commented Aug 25, 2024

@Nick-Nuon I think that the project is in really good shape. Lots of tests and good benchmarks. It was 'easy' for me to add ARM support. The only tricky part was the need to switch to .NET9.

@Nick-Nuon
Copy link
Collaborator

OK cool. Taking a look at it right now.

Splitting things up should make it easier to extend to AVX2 and AVX-512 without getting confused. :-)

It should help a bit yes :D

Copy link
Collaborator

@Nick-Nuon Nick-Nuon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK it looks good, there was one minor comment that was redundant but I took the liberty to trim it.

Merging

@Nick-Nuon Nick-Nuon merged commit bc4fcc0 into main Aug 26, 2024
1 check passed
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.

2 participants