Skip to content

Commit f30bc23

Browse files
Auto merge of #148925 - madsmtm:jemalloc-perf, r=<try>
Fix performance regression with jemalloc
2 parents 2286e5d + d4e5eb3 commit f30bc23

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ dependencies = [
600600
"serde_json",
601601
"tempfile",
602602
"termize",
603-
"tikv-jemalloc-sys",
604603
"toml 0.9.7",
605604
"ui_test",
606605
"walkdir",
@@ -4807,7 +4806,6 @@ dependencies = [
48074806
"stringdex",
48084807
"tempfile",
48094808
"threadpool",
4810-
"tikv-jemalloc-sys",
48114809
"tracing",
48124810
"tracing-subscriber",
48134811
"tracing-tree",

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ smallvec = "1.8.1"
2424
stringdex = "=0.0.3"
2525
tempfile = "3"
2626
threadpool = "1.8.1"
27-
tikv-jemalloc-sys = { version = "0.6.1", optional = true, features = ['override_allocator_on_supported_platforms'] }
2827
tracing = "0.1"
2928
tracing-tree = "0.3.0"
3029
unicode-segmentation = "1.9"
@@ -43,7 +42,7 @@ minifier = { version = "0.3.2", default-features = false }
4342
expect-test = "1.4.0"
4443

4544
[features]
46-
jemalloc = ["dep:tikv-jemalloc-sys"]
45+
jemalloc = []
4746

4847
[package.metadata.rust-analyzer]
4948
rustc_private = true

src/librustdoc/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ extern crate rustc_target;
6161
extern crate rustc_trait_selection;
6262
extern crate test;
6363

64+
/// See docs in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc/src/main.rs
65+
/// and https://github.com/rust-lang/rust/pull/146627 for why we need this.
66+
///
67+
/// NOTE: This is loaded from the sysroot that was built with the other `rustc` crates above, for
68+
/// some unknown reason this is more performant than building this with Cargo.
69+
#[cfg(feature = "jemalloc")]
70+
extern crate tikv_jemalloc_sys as _;
71+
6472
use std::env::{self, VarError};
6573
use std::io::{self, IsTerminal};
6674
use std::path::Path;
@@ -72,10 +80,6 @@ use rustc_interface::interface;
7280
use rustc_middle::ty::TyCtxt;
7381
use rustc_session::config::{ErrorOutputType, RustcOptGroup, make_crate_type_option};
7482
use rustc_session::{EarlyDiagCtxt, getopts};
75-
/// See docs in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc/src/main.rs
76-
/// and https://github.com/rust-lang/rust/pull/146627 for why we need this `use` statement.
77-
#[cfg(feature = "jemalloc")]
78-
use tikv_jemalloc_sys as _;
7983
use tracing::info;
8084

8185
use crate::clean::utils::DOC_RUST_LANG_ORG_VERSION;

src/tools/clippy/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ tempfile = { version = "3.20", optional = true }
3131
termize = "0.2"
3232
color-print = "0.3.4"
3333
anstream = "0.6.18"
34-
tikv-jemalloc-sys = { version = "0.6.1", optional = true, features = ['override_allocator_on_supported_platforms'] }
3534

3635
[dev-dependencies]
3736
cargo_metadata = "0.18.1"
@@ -57,7 +56,7 @@ rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
5756
[features]
5857
integration = ["dep:tempfile"]
5958
internal = ["dep:clippy_lints_internal", "dep:tempfile"]
60-
jemalloc = ["dep:tikv-jemalloc-sys"]
59+
jemalloc = []
6160

6261
[package.metadata.rust-analyzer]
6362
# This package uses #[feature(rustc_private)]

src/tools/clippy/src/driver.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ extern crate rustc_session;
1414
extern crate rustc_span;
1515

1616
/// See docs in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc/src/main.rs
17-
/// and https://github.com/rust-lang/rust/pull/146627 for why we need this `use` statement.
17+
/// and https://github.com/rust-lang/rust/pull/146627 for why we need this.
18+
///
19+
/// NOTE: This is loaded from the sysroot that was built with the other `rustc` crates above, for
20+
/// some unknown reason this is more performant than building this with Cargo.
1821
#[cfg(feature = "jemalloc")]
19-
use tikv_jemalloc_sys as _;
22+
extern crate tikv_jemalloc_sys as _;
2023

2124
use clippy_utils::sym;
2225
use declare_clippy_lint::LintListBuilder;

0 commit comments

Comments
 (0)