# extension_host: Turn on parallel compilation \(\#30942\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 26a8cac0d8d963992242955a1ce1398ec8358354

Requested commit: 26a8cac0d8d963992242955a1ce1398ec8358354

Commit: 26a8cac0d8d963992242955a1ce1398ec8358354

Tree: e248c7871bf8a7a5e509e48cda6c3dc44ac373a3

Author: Ben Brandt

Committer: GitHub

## Message

````
extension_host: Turn on parallel compilation (#30942)

Precursor to other optimizations, but this already gets us a big
improvement.

Wasm compilation can easily be parallelized, and with all of the cores
on my M4 Max this already gets us an 86% improvement, bringing loading
an extension down to <9ms.

Not all setups will see this much improvement, but it will use the cores
available (it just uses rayon under the hood like we do elsewhere).
Since we load extensions in sequence, this should have a nice impact for
users with a lot of extensions.

#### Before

```
Benchmarking load: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 5.0s. You may wish to increase target time to 6.5s, or reduce sample count to 70.
load                    time:   [64.859 ms 64.935 ms 65.027 ms]
Found 8 outliers among 100 measurements (8.00%)
  2 (2.00%) low mild
  3 (3.00%) high mild
  3 (3.00%) high severe
```

#### After

```
load                    time:   [8.8685 ms 8.9012 ms 8.9344 ms]
                        change: [-86.347% -86.292% -86.237%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
```

Release Notes:

- N/A
````

## Parents

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

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