IEnumerable<T> serialize improvement: Enumerable.TryGetNonEnumeratedCount by pCYSl5EDgo · Pull Request #1751 · MessagePack-CSharp/MessagePack-CSharp · GitHub
Skip to content

IEnumerable<T> serialize improvement: Enumerable.TryGetNonEnumeratedCount#1751

Merged
AArnott merged 1 commit into
MessagePack-CSharp:developfrom
pCYSl5EDgo:net6-TryGetNonEnumeratedCount
Jan 28, 2024
Merged

IEnumerable<T> serialize improvement: Enumerable.TryGetNonEnumeratedCount#1751
AArnott merged 1 commit into
MessagePack-CSharp:developfrom
pCYSl5EDgo:net6-TryGetNonEnumeratedCount

Conversation

@pCYSl5EDgo

@pCYSl5EDgo pCYSl5EDgo commented Jan 28, 2024

Copy link
Copy Markdown
Contributor

Enumerable.TryGetNonEnumeratedCount is efficient API for getting Count when dealing with IEnumerable<T>.
IEnumerable<T> generated by LINQ can be more efficiently counted since this API can access dotnet's internal interface IIListProvider<T>'s GetCount method.

@AArnott AArnott left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks like a good change.

@AArnott AArnott merged commit f29991b into MessagePack-CSharp:develop Jan 28, 2024
@pCYSl5EDgo pCYSl5EDgo deleted the net6-TryGetNonEnumeratedCount branch January 28, 2024 14:52
This was referenced Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants