Unnamed repository; edit this file 'description' to name the repository.
Drop unused profile things
Lukas Wirth 2024-07-07
parent 8f27046 · commit 90682c3
-rw-r--r--Cargo.lock10
-rw-r--r--crates/hir-def/Cargo.toml1
-rw-r--r--crates/hir-def/src/item_scope.rs4
-rw-r--r--crates/ide/src/status.rs3
-rw-r--r--crates/profile/Cargo.toml4
-rw-r--r--crates/profile/src/lib.rs7
-rw-r--r--crates/rust-analyzer/src/cli/analysis_stats.rs4
7 files changed, 0 insertions, 33 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f30f69eb6e..c63d659543 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -221,11 +221,6 @@ name = "countme"
version = "3.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7704b5fdd17b18ae31c4c1da5a2e0305a2bf17b5249300a9ee9ed7b72114c636"
-dependencies = [
- "dashmap",
- "once_cell",
- "rustc-hash",
-]
[[package]]
name = "cov-mark"
@@ -548,7 +543,6 @@ dependencies = [
"limit",
"mbe",
"once_cell",
- "profile",
"ra-ap-rustc_abi",
"ra-ap-rustc_parse_format",
"rustc-hash",
@@ -1400,13 +1394,9 @@ name = "profile"
version = "0.0.0"
dependencies = [
"cfg-if",
- "countme",
- "la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc",
- "once_cell",
"perf-event",
"tikv-jemalloc-ctl",
- "tracing",
"windows-sys 0.52.0",
]
diff --git a/crates/hir-def/Cargo.toml b/crates/hir-def/Cargo.toml
index 41c59ea0d9..660799d610 100644
--- a/crates/hir-def/Cargo.toml
+++ b/crates/hir-def/Cargo.toml
@@ -37,7 +37,6 @@ stdx.workspace = true
intern.workspace = true
base-db.workspace = true
syntax.workspace = true
-profile.workspace = true
hir-expand.workspace = true
mbe.workspace = true
cfg.workspace = true
diff --git a/crates/hir-def/src/item_scope.rs b/crates/hir-def/src/item_scope.rs
index 9c7dfa05b0..d86c0667a0 100644
--- a/crates/hir-def/src/item_scope.rs
+++ b/crates/hir-def/src/item_scope.rs
@@ -8,7 +8,6 @@ use hir_expand::{attrs::AttrId, db::ExpandDatabase, name::Name, AstId, MacroCall
use itertools::Itertools;
use la_arena::Idx;
use once_cell::sync::Lazy;
-use profile::Count;
use rustc_hash::{FxHashMap, FxHashSet};
use smallvec::{smallvec, SmallVec};
use stdx::format_to;
@@ -65,8 +64,6 @@ pub struct ImportId {
#[derive(Debug, Default, PartialEq, Eq)]
pub struct ItemScope {
- _c: Count<Self>,
-
/// Defs visible in this scope. This includes `declarations`, but also
/// imports. The imports belong to this module and can be resolved by using them on
/// the `use_imports_*` fields.
@@ -722,7 +719,6 @@ impl ItemScope {
pub(crate) fn shrink_to_fit(&mut self) {
// Exhaustive match to require handling new fields.
let Self {
- _c: _,
types,
values,
macros,
diff --git a/crates/ide/src/status.rs b/crates/ide/src/status.rs
index 8e7767c8e5..69526ddef9 100644
--- a/crates/ide/src/status.rs
+++ b/crates/ide/src/status.rs
@@ -44,9 +44,6 @@ pub(crate) fn status(db: &RootDatabase, file_id: Option<FileId>) -> String {
format_to!(buf, "{}\n", collect_query(LibrarySymbolsQuery.in_db(db)));
format_to!(buf, "{}\n", collect_query(ModuleSymbolsQuery.in_db(db)));
format_to!(buf, "{} in total\n", memory_usage());
- if env::var("RA_COUNT").is_ok() {
- format_to!(buf, "\nCounts:\n{}", profile::countme::get_all());
- }
format_to!(buf, "\nDebug info:\n");
format_to!(buf, "{}\n", collect_query(AttrsQuery.in_db(db)));
diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml
index 11a8e7af56..5989dc6c96 100644
--- a/crates/profile/Cargo.toml
+++ b/crates/profile/Cargo.toml
@@ -12,12 +12,8 @@ rust-version.workspace = true
doctest = false
[dependencies]
-once_cell = "1.17.0"
-tracing.workspace = true
cfg-if = "1.0.0"
-la-arena.workspace = true
libc.workspace = true
-countme = { version = "3.0.1", features = ["enable"] }
jemalloc-ctl = { version = "0.5.0", package = "tikv-jemalloc-ctl", optional = true }
[target.'cfg(target_os = "linux")'.dependencies]
diff --git a/crates/profile/src/lib.rs b/crates/profile/src/lib.rs
index c1ae0d43d0..205341f162 100644
--- a/crates/profile/src/lib.rs
+++ b/crates/profile/src/lib.rs
@@ -12,13 +12,6 @@ pub use crate::{
stop_watch::{StopWatch, StopWatchSpan},
};
-pub use countme;
-/// Include `_c: Count<Self>` field in important structs to count them.
-///
-/// To view the counts, run with `RA_COUNT=1`. The overhead of disabled count is
-/// almost zero.
-pub use countme::Count;
-
thread_local!(static IN_SCOPE: RefCell<bool> = const { RefCell::new(false) });
/// A wrapper around google_cpu_profiler.
diff --git a/crates/rust-analyzer/src/cli/analysis_stats.rs b/crates/rust-analyzer/src/cli/analysis_stats.rs
index a934e14ddb..c9c19806be 100644
--- a/crates/rust-analyzer/src/cli/analysis_stats.rs
+++ b/crates/rust-analyzer/src/cli/analysis_stats.rs
@@ -250,10 +250,6 @@ impl flags::AnalysisStats {
}
report_metric("total memory", total_span.memory.allocated.megabytes() as u64, "MB");
- if env::var("RA_COUNT").is_ok() {
- eprintln!("{}", profile::countme::get_all());
- }
-
if self.source_stats {
let mut total_file_size = Bytes::default();
for e in ide_db::base_db::ParseQuery.in_db(db).entries::<Vec<_>>() {