Add ADVSIMD64 optimizations for System.Text.Encodings.Web#49847
Add ADVSIMD64 optimizations for System.Text.Encodings.Web#49847GrabYourPitchforks merged 2 commits intodotnet:mainfrom
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
...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.