-
Notifications
You must be signed in to change notification settings - Fork 470
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
ImmutableHashSetExtensions.AddRange could probably be faster #5870
Comments
Can you rebuild from the command line with |
We can't make this change blindly. The algorithm currently has specific semantics surrounding which instance of two equal items is included in the final set, and this is order-dependent. It does seem likely that we can improve things by calling |
Thanks for the quick reply and instructions. Result:
I reported it to SonarSource. Though, I'm not sure at this point if this should be fixed by both or neither :) FWIW, some more PerfView traces:
|
Another side note: Is there an easier way to investigate what assembly (or file) is the issue? I'm personally a big fan of ETW events. Has roslyn analzyer thought about adding ETW event? For instance Getting the our project to finish compiling with the analyzers on was very challenging. I had to take a smaller part and run the compilation on it. Building a full solution with the analyzer never finished. |
Sam, just a quick note before the weekend: I removed all the SonarSource analyzers completely. Still seeing a lot of time in the PointsToAbstractValueDomain.Merge function. So I think still a good idea to potentially improve something in there. I wish I could help more but I have no clue how I would try out any source code changes in this repo :/ |
There is a section in the README about setting up the environment, although it's a bit hidden between other sections. |
Hi all,
on my dev PC I'm noticing a very busy (CPU) 'Roslyn.Worker` (Resharper). Our code base is relatively big. 28k files.
I've just ran a very quick 20s PerfView and noticed the following:
Note: This method is about 66% of all my CPU time.
which lead me to:
https://github.com/dotnet/roslyn-analyzers/blob/main/src/Utilities/Compiler/Extensions/ImmutableHashSetExtensions.cs#L10-L35
I think this could be made faster. Note, the entire performance is in "Union" (which is what's called inside
HashSet.ToImmutableHashSet
).I think it would be better to:
This should be strictly faster since currently
set.ToImmutable
does the same but starts with an empty set.I'm sorry I can't try it out myself. I have honestly no clue about roslyn analyzers and this repo.
There is also
immutableHashSet.Union()
but it seems it does not take the "bigger" set as the base of where to start from.The text was updated successfully, but these errors were encountered: