Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: use jemalloc as global allocator #18957

Merged
merged 3 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ tar = "=0.4.38"
tempfile = "3.4.0"
thiserror = "=1.0.38"
tokio = { version = "1.25.0", features = ["full"] }
tikv-jemallocator = "0.5.0"
tikv-jemalloc-sys = "0.5.3"
tokio-rustls = "0.23.3"
tokio-util = "0.7.4"
tower-lsp = { version = "=0.17.0", features = ["proposed"] }
Expand Down
3 changes: 3 additions & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ winapi = { workspace = true, features = ["knownfolders", "mswsock", "objbase", "
[target.'cfg(unix)'.dependencies]
nix.workspace = true

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemallocator.workspace = true

[dev-dependencies]
deno_bench_util.workspace = true
dotenv = "=0.15.0"
Expand Down
7 changes: 7 additions & 0 deletions cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ mod version;
mod watcher;
mod worker;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

use crate::args::flags_from_vec;
use crate::args::DenoSubcommand;
use crate::args::Flags;
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ url.workspace = true
v8.workspace = true

[target.'cfg(not(target_env = "msvc"))'.dependencies]
tikv-jemalloc-sys = "0.5"
tikv-jemalloc-sys.workspace = true

[[example]]
name = "http_bench_json_ops"
Expand Down