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

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

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

Visibility: public

Requested revision: 2364f6b22ee71ffc7dd394a3ee51ef52357878b9

Requested commit: 2364f6b22ee71ffc7dd394a3ee51ef52357878b9

Commit: 2364f6b22ee71ffc7dd394a3ee51ef52357878b9

Tree: 6bdaf45c8c5652a39e470d36197d0825d31b77e0

Author: Piotr Osiewicz

Committer: Piotr Osiewicz

## Message

```
gpui2: Type-erase futures.

Project2's LLVM IR size is ~20-25% 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  |

```

## Parents

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

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