Skip to content
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

RCS1077 - FirstOrDefault() is faster than Find() with .NET 9 #1531

Closed
symbiogenesis opened this issue Sep 19, 2024 · 3 comments · Fixed by #1563
Closed

RCS1077 - FirstOrDefault() is faster than Find() with .NET 9 #1531

symbiogenesis opened this issue Sep 19, 2024 · 3 comments · Fixed by #1563
Assignees

Comments

@symbiogenesis
Copy link

With .NET 8 and below, the recommendation to use Find() is correct.

But with .NET 9 or later, LINQ is actually faster.

https://www.youtube.com/watch?v=UfjRoshu23w&t=575s

@josefpihrt
Copy link
Collaborator

Interesting. Maybe it makes sense to remove this suggestion.

@symbiogenesis
Copy link
Author

Would it make sense to actively suggest the reverse on .NET9 and above?

@josefpihrt
Copy link
Collaborator

@symbiogenesis Please create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants