# gpui2: Type-erase futures\. \(\#3266\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e4bc03217de247507cffbcc9faaac230580d1f51

Requested commit: e4bc03217de247507cffbcc9faaac230580d1f51

Commit: e4bc03217de247507cffbcc9faaac230580d1f51

Tree: a0f70c4d498e589e9f1801476a084a50c923930e

Author: Antonio Scandurra

Committer: GitHub

## Message

```
gpui2: Type-erase futures. (#3266)

Project2's LLVM IR size is ~33-44% bigger than project1 due to the fact
that in gpui2 we call async_task::spawn(_local) with impl Future instead
of dyn Future, which leads to quite a few more instantiations of
RawTask.

LLVM-IR size for project2:
|  build_type  |  main   |  this branch  | project1 |
|  debug       | 2617795 |    2022814    | 1817866  |
|  release     | 4439033 |    3715086    | 3314489  |

Note that this PR is in line with what was done in GPUI1 (we've also
boxed futures there).
Release Notes:

- N/A
```

## Parents

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

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

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