-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add ADVSIMD64 optimizations for System.Text.Encodings.Web #49847
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
Add ADVSIMD64 optimizations for System.Text.Encodings.Web #49847
Conversation
|
Tagging subscribers to this area: @tarekgh, @eiriktsarpalis, @layomia Issue DetailsThis is a follow-up PR to #49373 which adds ARM64 SIMD optimizations to the FindFirstCharacterToEncode code paths. I'm not able to run BenchmarkDotNet on my SPX device for some reason, but I created a small console application to get some quick measurements. Baseline (release/5.0): 46 ns for The .AdvSimd64.cs file is basically a carbon copy of the .Ssse3.cs file, but using AMD64 patterns ( We're relying on the increased unit test coverage given by the previous PR. I've also augmented the unit tests with an extra "insert this scurrilous BMP code point" check to validate that our UTF-16 -> ASCII conversion is working properly.
|
|
Heads up that you're likely to see changes in the perf lab benchmark here and in System.Text.Json as a result of recent PRs.
|
...stem.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.AdvSimd64.cs
Show resolved
Hide resolved
...stem.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.AdvSimd64.cs
Outdated
Show resolved
Hide resolved
eiriktsarpalis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
...braries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.cs
Show resolved
Hide resolved
|
Thanks for the tag @GrabYourPitchforks. We will keep an eye out for this on Tuesday when we triage. |
|
Green CI? Sure, I'll take it! |
@GrabYourPitchforks what error are you getting? |
This is a follow-up PR to #49373 which adds ARM64 SIMD optimizations to the FindFirstCharacterToEncode code paths. I'm not able to run BenchmarkDotNet on my SPX device for some reason, but I created a small console application to get some quick measurements.
Baseline (release/5.0): 46 ns for
HtmlEncoder.Default.FindFirstCharacterToEncodeUtf8(u8"The quick brown fox jumps over the lazy dog.")advsimd-optimized: 8.8 ns for same input. (-81% wall clock time taken)
The .AdvSimd64.cs file is basically a carbon copy of the .Ssse3.cs file, but using AMD64 patterns (
tblandaddp) instead of SSSE3 instructions (pshufbandpmovmskb).We're relying on the increased unit test coverage given by the previous PR. I've also augmented the unit tests with an extra "insert this scurrilous BMP code point" check to validate that our UTF-16 -> ASCII conversion is working properly.