mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
print one size for symbols
This commit is contained in:
parent
aae69bc897
commit
50a7598773
@ -94,17 +94,12 @@ impl FromIterator<TableEntry<FileId, TreeArc<SourceFile>>> for SyntaxTreeStats {
|
||||
#[derive(Default)]
|
||||
struct LibrarySymbolsStats {
|
||||
total: usize,
|
||||
fst_size: Bytes,
|
||||
symbols_size: Bytes,
|
||||
size: Bytes,
|
||||
}
|
||||
|
||||
impl fmt::Display for LibrarySymbolsStats {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
fmt,
|
||||
"{} ({} + {}) symbols",
|
||||
self.total, self.fst_size, self.symbols_size
|
||||
)
|
||||
write!(fmt, "{} ({}) symbols", self.total, self.size,)
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,8 +112,7 @@ impl FromIterator<TableEntry<SourceRootId, Arc<SymbolIndex>>> for LibrarySymbols
|
||||
for entry in iter {
|
||||
let value = entry.value.unwrap();
|
||||
res.total += value.len();
|
||||
res.fst_size += value.fst_size();
|
||||
res.symbols_size += value.symbols_size();
|
||||
res.size += value.memory_size();
|
||||
}
|
||||
res
|
||||
}
|
||||
|
@ -137,12 +137,8 @@ impl SymbolIndex {
|
||||
self.symbols.len()
|
||||
}
|
||||
|
||||
pub(crate) fn fst_size(&self) -> usize {
|
||||
self.map.as_fst().size()
|
||||
}
|
||||
|
||||
pub(crate) fn symbols_size(&self) -> usize {
|
||||
self.symbols.len() * mem::size_of::<FileSymbol>()
|
||||
pub(crate) fn memory_size(&self) -> usize {
|
||||
self.map.as_fst().size() * self.symbols.len() * mem::size_of::<FileSymbol>()
|
||||
}
|
||||
|
||||
pub(crate) fn for_files(
|
||||
|
Loading…
Reference in New Issue
Block a user