Uh oh!
There was an error while loading. Please reload this page.
Vectorize ProbabilisticMap.IndexOfAny - #80963
Conversation
ghost
commented
Jan 21, 2023
Tagging subscribers to this area: @dotnet/area-system-memory Issue Details
Benchmark sourcepublicclassReplaceLineEndingsBenchmark{privatestring_input;[Params(0.0,0.05,0.1,0.2,1.0)]publicdoubleNewLineFrequency;[Params(10_000)]publicintLength;[GlobalSetup]publicvoidSetup(){char[]input=newchar[Length];varrng=newRandom(42);for(inti=0;i<input.Length;i++){if(rng.NextDouble()<NewLineFrequency){input[i]='\n';}else{charc;do{c=(char)rng.Next(0,65536);}while("\r\n\f\u0085\u2028\u2029".Contains(c));input[i]=c;}}_input=newstring(input);}[Benchmark]publicstringReplaceLineEndings()=>_input.ReplaceLineEndings();}If we care, we could also do this for I don't know if it's possible to do something similar efficiently on ARM given that the bloom filter in this case is 256-bit.
|
MihaZupan
commented
Jan 21, 2023
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f96031d to
9af50f6CompareAdded |
9af50f6 to
9c67c08Compare9c67c08 to
399770bCompareUh oh!
There was an error while loading. Please reload this page.
399770b to
8761d76Comparelewing
commented
Feb 8, 2023
@radekdoulik we should add PackedSimd versions of the Unsafe* functions wasm supports to ease handling all the calling callers. I'm not sure we have a great pattern to simplify the *.IsHardwareAccelerated paths that works for all the cases yet but that is worth considering too. |
MihaZupan
commented
Feb 10, 2023
Any thoughts on this @dotnet/area-system-memory? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
These are different because shifting via byte isn't accelerated on xarch, right?
There was a problem hiding this comment.
Yes. We do the same thing in IndexOfAnyAsciiSearcher as well, where that also feeds into a shuffle
There was a problem hiding this comment.
👍, probably worth opening an issue so an efficient implementation can be done and we can avoid the separate paths here.
Uh oh!
There was an error while loading. Please reload this page.
MihaZupan
commented
Feb 24, 2023
MihaZupan
commented
Feb 28, 2023
Anything else that should be changed here, or is this one good to merge @tannergooding? |
MihaZupan
commented
Mar 3, 2023
@tannergooding can this be merged? (I'm trying to avoid more merge conflicts as this was already rebased a fair number of times) |
tannergooding
commented
Mar 8, 2023
Another merge conflict popped up. Would be good to see some more benchmark numbers to better display where the cutoff is for the index ratio. Likely also needs a secondary review from someone like @stephentoub given the code its touching. |
8482f56 to
a753250CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
stephentoub
commented
Mar 10, 2023
Thanks! |
AVX2
ARM64
Benchmark source
If we care, we could also do this for
LastIndexOfAny.#80297 could be interesting for ARM if we could do a 256-bit lookup instead of blending together smaller lookups.