Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve get/set performance in HashSet<T> #40106
Similar optimization in Dictionary<,> has been ported to HashSet<>.
The major optimization is under
Now it becomes:
I've intentionally kept the origin implementation and comments as
The benchmark shows there're obvious improvements in get and set
The benchmark also shows the optimized
The benchmark code can be found in https://github.com/JeffreyZhao/HashSetPerf, in which the
BenchmarkDotNet=v0.11.5, OS=Windows 10.0.17763.615 (1809/October2018Update/Redstone5) Intel Core i7-7700HQ CPU 2.80GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores .NET Core SDK=3.0.100-preview7-012821 [Host] : .NET Core 3.0.0-preview7-27912-14 (CoreCLR 4.700.19.32702, CoreFX 4.700.19.36209), 64bit RyuJIT DefaultJob : .NET Core 3.0.0-preview7-27912-14 (CoreCLR 4.700.19.32702, CoreFX 4.700.19.36209), 64bit RyuJIT
Thanks, I've noticed that now. BTW why it's not part of previous step (compile and test) but "Send to Helix", and what's that step?
It seems we don't have any coverage for
Yes, I've noticed that too. That's what I mean by this:
There're actually more optimizations can be put in