Use mimalloc as default allocator (#7140)

From https://github.com/microsoft/mimalloc:
> In our benchmarks (see
[below](https://github.com/microsoft/mimalloc#performance)), mimalloc
outperforms other leading allocators (jemalloc, tcmalloc, Hoard, etc),
and often uses less memory. A nice property is that it does consistently
well over a wide range of benchmarks. There is also good huge OS page
support for larger server programs.


Release Notes:

- Changed default allocator to mimalloc.
This commit is contained in:
Ares Andrew 2024-02-01 01:50:37 +08:00 committed by GitHub
parent b7ced3943e
commit 59f77d316f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 0 deletions

View file

@ -18,6 +18,7 @@ use language::LanguageRegistry;
use log::LevelFilter;
use assets::Assets;
use mimalloc::MiMalloc;
use node_runtime::RealNodeRuntime;
use parking_lot::Mutex;
use release_channel::{parse_zed_link, AppCommitSha, ReleaseChannel, RELEASE_CHANNEL};
@ -57,6 +58,9 @@ use zed::{
OpenRequest,
};
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
fn main() {
menu::init();
zed_actions::init();