Skip to content

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

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

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

Conversation

@pCYSl5EDgo
Copy link
Contributor

@pCYSl5EDgo pCYSl5EDgo commented Jan 28, 2024

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.

Copy link
Collaborator

@AArnott AArnott left a comment

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
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

Comments