Drop unused profile things

This commit is contained in:
Lukas Wirth 2024-07-07 08:24:10 +02:00
parent 8f2704654c
commit 90682c393d
7 changed files with 0 additions and 33 deletions

10
Cargo.lock generated
View file

@ -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",
]

View file

@ -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

View file

@ -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,

View file

@ -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)));

View file

@ -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]

View file

@ -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.

View file

@ -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<_>>() {