-
Notifications
You must be signed in to change notification settings - Fork 226
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
Fix S6605 FP: Any is faster than Exists in .NET 9 #9665
Comments
Like #9664 (comment) , |
Hello @marco-carvalho, Thank you for pointing this out. Have a great day! |
I think advising the other way around does not make sense. We're dealing with a difference of 2 nanoseconds. You could consider report to Microsoft thought, as it is strange that a native method ( |
Hello,
The rule S6605 may no longer be applicable for projects targeting .NET 9.0.
Recent benchmarks indicate that starting with .NET 9.0,
Any
is actually faster thanExists
. Below are the benchmark results.Code:
Results:
Maybe this rule for code targeting .NET 8.0 or below, and a new rule
"Any" method should be used instead of the "Exists"
for code targeting .NET 9.0 or above?The text was updated successfully, but these errors were encountered: