Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

bclehmann
Copy link
Member

Discussed in #5078, a breaking change seems fine here given that discussion.

@bclehmann
Copy link
Member Author

bclehmann commented Sep 9, 2025

FWIW I decided against using IEnumerable since there are still a lot of performance problems there (and the purpose of this change is 99% around performance). They are being largely addressed by .NET 10 apparently. This does make implementing a collection that allocates once and never again notably harder. I still don't think it's bad, you just can't yield return the implementation away.

Besides, most users should be able to get away with ArraySegment, possibly with ArrayPool in the background. Still not sure of the status of ArraySegment on certain NET Framework versions, but I think it's kosher on everything .NET Standard 2.1 and later.

Come to think of it, replacing most of our explicit array constructions with ArrayPool and ArraySegment would be a decent project to consider (provided it's possible on all of our targets).

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.

1 participant