-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Try new .Net Core 2.1 PopCount() intrinsic for HAMT implementation #5
Comments
Have you done that? May I do it? |
No, not yet. Yes, you can try! |
…ts and the old benchmarks from DryIoc for #5
@dzmitry-lahoda I have added two basic HAMT implementations into the Playground project with some tests. There are two (or more) implementations: The method(s) to consider for replace with
The hand-written benchmarks (without BenchmarkDotNet) are in https://github.com/dadhi/ImTools/blob/master/src/Playground/TreeBenchmarks.cs |
I did in my fork as it has .NET Core only build (i have hard time work with legacy projects:() https://github.com/dzmitry-lahoda/ImTools/blob/unnoficial/src/Playground/BitCountsBenchmarks.cs For synthetic benchmark.
I guess need to make TreeBenchmarks to be BDN. And add copy of Trie code. Will send results. I guess I may merge these classes into separate branch and send pull. But better if whole solution will be .NET Core for contrib. |
Strange result.
So seem no need to popcnt for now for specific case. |
I see Trie is faster than Tree always. And only slower on 1M items to add. Interesting replacement of IoC. But may be be better try out BDN to measure memory and reduce any fluctuations. E.g. right now GC.Collect() seems(not sure) starts GC, but not waits to finish. |
popcnt is with netcoreapp3.0 preview. not with 2.1 or 2.2:) so I suggest to close story as it seems irrelevant for both performance and usage in near future. |
Thanks for the test.
I will keep it open until I played with it myself, will decide how to proceed later. |
I was trying to get the code of intrinsic for some reason. Found that for .NET Core 2.1 there should be kind of |
Currently it uses HammingWeight algorithm for calculating number of set bits in a int value:
https://bitbucket.org/dadhi/dryioc/src/e788ffce78b727b35fda5355a2297d40f0e7731b/Net45/Playground/HashArrayMappedTrieTests.cs#lines-190
Here is the thing Aye, that's there
System.Runtime.Intrinsics.X86.PopCount(uint/ulong)
First step will to BDN benchmark against Swar or HammingWeight with PopCount.
The text was updated successfully, but these errors were encountered: