more stats

This commit is contained in:
Aleksey Kladov 2019-01-25 17:20:52 +03:00
parent 8d68b76ba0
commit 046ae1d361
2 changed files with 133 additions and 36 deletions

View file

@ -23,6 +23,7 @@ use std::{
cmp::Ordering,
hash::{Hash, Hasher},
sync::Arc,
mem,
};
use fst::{self, Streamer};
@ -136,6 +137,14 @@ 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 for_files(
files: impl ParallelIterator<Item = (FileId, TreeArc<SourceFile>)>,
) -> SymbolIndex {