dotnet / dotnet/efcore

Create a List with the appropriate capacity if we know it when using ToListAsync

Open
#29,727 0 comments 0 reactions 0 assignees View on GitHub
area-perf area-query
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Inspired by #29720. If we know how many items will go into the list (for example, because of buffering) then create the `List` object with that capacity. Note we can only do this for `ToListAsync`, not `ToList`, since we don't own the implementation of the latter.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.