linux: Spawn at least two background threads (#44110) (cherry-pick to preview) (#44157)
zed-zippy[bot]
and
Agus Zubiaga
created
Cherry-pick of #44110 to preview
----
Related to https://github.com/zed-industries/zed/pull/44109,
https://github.com/zed-industries/zed/issues/43884,
https://github.com/zed-industries/zed/issues/43809.
In the Linux dispatcher, we create one background thread per CPU, but
when a single core is available, having a single background thread
significantly hinders the perceived performance of Zed. This is
particularly helpful when SSH remoting to low-resource servers.
We may want to bump this to more than two threads actually, but I wanted
to be conservative, and this seems to make a big difference already.
Release Notes:
- N/A
Co-authored-by: Agus Zubiaga <agus@zed.dev>