# Speed up \`cargo build \-p zed\` compilation \(\#62059\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 21f16f7b5b968092cf4cd9cb38684a2854834fda

Requested commit: 21f16f7b5b968092cf4cd9cb38684a2854834fda

Commit: 21f16f7b5b968092cf4cd9cb38684a2854834fda

Tree: 0370ddfe20c6a1aa18209fcd9376c4166180aac6

Author: Kirill Bulatov

Committer: GitHub

## Message

```
Speed up `cargo build -p zed` compilation (#62059)

Splits the crate graph.
Before, the compilation graph: `editor → picker_preview → search →
project_panel → open_path_prompt → recent_projects → title_bar →
collab_ui → zed`
After, the compilation graph: `editor → picker_preview → search →
agent_ui → sidebar → zed`

With sccache disabled and project fully built, `touch
crates/editor/src/editor.rs` and `cargo build -p zed` took time
Before (5e1fd392f6): 13.19s
After: 11.85s (-10.2% speed up)

Each commit contains a separate compilation instructions, and a test in
the final commit.
The main approach is to split coupled crates and replace them with
`zed_actions` and move some shared functionality into `git_ui_core` new,
shared module.

I've also tried to add a test to prevent common pitfalls, but not sure
I'm happy with the end result — can remove it if it looks too synthetic.

Release Notes:

- N/A
```

## Parents

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

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