# Always read files to string on a background thread \(\#9341\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7629c161622ebda383b98f540cc7991ca9a6bd51)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7629c161622ebda383b98f540cc7991ca9a6bd51

Requested commit: 7629c161622ebda383b98f540cc7991ca9a6bd51

Commit: 7629c161622ebda383b98f540cc7991ca9a6bd51

Tree: f99a03399611e5434d1a962f14422d03a9e836d0

Author: Thorsten Ball

Committer: GitHub

## Message

```
Always read files to string on a background thread (#9341)

We noticed that when you open a lot of files (i.e. project-wide search
with multi-buffer) that the main thread can become unresponsive, because
while we are async, we still load these files on the main thread.

What this change does is it uses `smol::unblock` to load files on a
different thread.

Release Notes:

- Improved responsiveness when loading files into memory.

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Kirill <kirill@zed.dev>
```

## Parents

- [c015baa6385202af1a965c6346af71426c7e377e](https://git.cafe/gitcafe/zed/commit/c015baa6385202af1a965c6346af71426c7e377e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7629c161622ebda383b98f540cc7991ca9a6bd51?format=markdown)
