aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/symbol_index.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-25 14:20:52 +0000
committerAleksey Kladov <[email protected]>2019-01-25 14:25:23 +0000
commit046ae1d361d8941a664919e7668a65ae735d4a1b (patch)
tree17579217a78602653518bc86b96edbf9a80d5437 /crates/ra_ide_api/src/symbol_index.rs
parent8d68b76ba01dcd190e037e4d61a94d4c9d568bdd (diff)
more stats
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs
index 1b5d1eb1d..69a669b8d 100644
--- a/crates/ra_ide_api/src/symbol_index.rs
+++ b/crates/ra_ide_api/src/symbol_index.rs
@@ -23,6 +23,7 @@ use std::{
23 cmp::Ordering, 23 cmp::Ordering,
24 hash::{Hash, Hasher}, 24 hash::{Hash, Hasher},
25 sync::Arc, 25 sync::Arc,
26 mem,
26}; 27};
27 28
28use fst::{self, Streamer}; 29use fst::{self, Streamer};
@@ -136,6 +137,14 @@ impl SymbolIndex {
136 self.symbols.len() 137 self.symbols.len()
137 } 138 }
138 139
140 pub(crate) fn fst_size(&self) -> usize {
141 self.map.as_fst().size()
142 }
143
144 pub(crate) fn symbols_size(&self) -> usize {
145 self.symbols.len() * mem::size_of::<FileSymbol>()
146 }
147
139 pub(crate) fn for_files( 148 pub(crate) fn for_files(
140 files: impl ParallelIterator<Item = (FileId, TreeArc<SourceFile>)>, 149 files: impl ParallelIterator<Item = (FileId, TreeArc<SourceFile>)>,
141 ) -> SymbolIndex { 150 ) -> SymbolIndex {