Skip to content
Discussion options

You must be logged in to vote

Because rented array need to be explicitly returned. Let GC to return the array can harm the performance too.

Additionally, at which size pooling is beneficial tights to the pooling implementation. As dotnet/runtime#68800 (comment) shown, pooling small arrays can be far slower than allocating.

My question is: If renting an array from a shared memory pool is more performant than allocation, and the initial overhead of renting isn't large

This is not true. Initial overhead of renting is very large that CoreLib refuse to use any pool other than byte. The overhead includes a generic instantiation, and a minimal amount of arrays cached in the pool and never reclaimed.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@AlphaDelta
Comment options

Answer selected by AlphaDelta

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants