---
title: "One Minute Knowledge: Is ToArrayAsync or ToListAsync faster for Entity Framework?"
description: "Short question, and a short answer: `ToListAsync` - but why?"
updated: 2025-12-15
tags: ["EF", ".NET"]
canonical: "https://steven-giesel.com/blogPost/55dbb67c-cd14-444f-81e8-dec9f5ce1448/one-minute-knowledge-is-toarrayasync-or-tolistasync-faster-for-entity-framework"
---

# One Minute Knowledge: Is ToArrayAsync or ToListAsync faster for Entity Framework?

Short question, and a short answer: `ToListAsync` - but why?

## Let's check the code

`ToListAsync` is defined as:

```csharp
public static async Task<List<TSource>> ToListAsync<TSource>(
    this IQueryable<TSource> source,
    CancellationToken cancellationToken = default)
{
    var list = new List<TSource>();
    await foreach (var element in source.AsAsyncEnumerable().WithCancellation(cancellationToken).ConfigureAwait(false))
    {
        list.Add(element);
    }

    return list;
}
```
<sup>Source: https://github.com/dotnet/efcore/blob/94b2ee91070174c06a1753b3121b8bda0db4f36a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs#L2302-L2313</sup>

And `ToArrayAsync` is defined as:

```csharp
public static async Task<TSource[]> ToArrayAsync<TSource>(
    this IQueryable<TSource> source,
    CancellationToken cancellationToken = default)
    => (await source.ToListAsync(cancellationToken).ConfigureAwait(false)).ToArray();
```
<sup>Source: https://github.com/dotnet/efcore/blob/94b2ee91070174c06a1753b3121b8bda0db4f36a/src/EFCore/Extensions/EntityFrameworkQueryableExtensions.cs#L2337-L2338</sup>

So `ToArrayAsync` actually calls `ToListAsync` first, and then converts the resulting list to an array using `ToArray()`. So you get the overhead of creating a list, populating it, and then creating an array and copying the elements over.

This does not apply to `ToHashSetAsync`.