- Notifications
You must be signed in to change notification settings - Fork5.1k
Improve Ascii.FromUtf16 and FromHexString#102735
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Tagging subscribers to this area: @dotnet/area-system-text-encoding |
@EgorBot -intel -amd --disasm usingBenchmarkDotNet.Attributes;usingSystem.Buffers;usingSystem.Text;usingSystem;usingBenchmarkDotNet.Running;BenchmarkRunner.Run<AsciiBenchmarks>(args:args);publicclassAsciiBenchmarks{[Params(1000)]publicintLength;privatebyte[]_bytes;privatechar[]_chars;[GlobalSetup]publicvoidSetup(){_chars=newstring('a',Length).ToCharArray();_bytes=Encoding.ASCII.GetBytes(_chars);}[Benchmark]publicOperationStatusFromUtf16()=>Ascii.FromUtf16(_chars,_bytes,out_);} |
EgorBot commentedMay 28, 2024
More dataSeeBDN_Artifacts.zip for details. |
EgorBot commentedMay 28, 2024
More dataSeeBDN_Artifacts.zip for details. |
Whooooo nice bot@EgorBo. Pretty interesting...😅🧐 |
Uh oh!
There was an error while loading.Please reload this page.
@EgorBot -arm64 -amd --disasm usingBenchmarkDotNet.Attributes;usingSystem.Buffers;usingSystem.Text;usingSystem;usingBenchmarkDotNet.Running;BenchmarkRunner.Run<AsciiBenchmarks>(args:args);publicclassAsciiBenchmarks{[Params(1000)]publicintLength;privatebyte[]_bytes;privatechar[]_chars;[GlobalSetup]publicvoidSetup(){_chars=newstring('a',Length).ToCharArray();_bytes=Encoding.ASCII.GetBytes(_chars);}[Benchmark]publicOperationStatusFromHexString()=>Convert.FromHexString(_chars,_bytes,out_,out_);} |
EgorBot commentedMay 28, 2024 • edited by EgorBo
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by EgorBo
Uh oh!
There was an error while loading.Please reload this page.
More dataSeeBDN_Artifacts.zip for details. |
* Use cheaper Vector.Narrow altenatives in Ascii* Use existing Ascii helper in HexConverter
Uh oh!
There was an error while loading.Please reload this page.
We're already using things like
Sse2.PackUnsignedSaturate
instead ofVector128.Narrow
when we don't care about the edge case values (we've already validated the input).This PR does something similar for
Vector256
andVector512
paths.(this is with Avx2)
Diffs:https://gist.github.com/MihuBot/f60c7254060f436ae9c12ded701c85f8