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

IEnumerable.Count() performance #46036

Closed
8ggmaker opened this issue Dec 14, 2020 · 3 comments
Closed

IEnumerable.Count() performance #46036

8ggmaker opened this issue Dec 14, 2020 · 3 comments
Labels
area-System.Linq tenet-performance Performance related issue untriaged New issue has not been triaged by the area owner

Comments

@8ggmaker
Copy link
Member

Description

IEnumerable.Count() in System.Linq is optimized for ICollection type, should it has a fast path for IReadOnlyCollection to achieve better performace, too ?

public static int Count<TSource>(this IEnumerable<TSource> source)

If it is an improvement, I can provide a pull request for this. 😄

Thanks

@8ggmaker 8ggmaker added the tenet-performance Performance related issue label Dec 14, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Linq untriaged New issue has not been triaged by the area owner labels Dec 14, 2020
@ghost
Copy link

ghost commented Dec 14, 2020

Tagging subscribers to this area: @eiriktsarpalis
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

IEnumerable.Count() in System.Linq is optimized for ICollection type, should it has a fast path for IReadOnlyCollection to achieve better performace, too ?

public static int Count<TSource>(this IEnumerable<TSource> source)

If it is an improvement, I can provide a pull request for this. 😄

Thanks

Author: zsybupt
Assignees: -
Labels:

area-System.Linq, tenet-performance, untriaged

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Dec 14, 2020

#42254

@eiriktsarpalis
Copy link
Member

eiriktsarpalis commented Dec 14, 2020

Closing as duplicate of #42254.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Linq tenet-performance Performance related issue untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants