Merge pull request #19378 from davidbarsky/davidbarsky/run-lru-at-end-of-analysis-stats
analysis-stats: run Salsa's LRU at the end of analysis
This commit is contained in:
commit
5cc6d29e67
1 changed files with 8 additions and 2 deletions
|
|
@ -22,7 +22,10 @@ use ide::{
|
|||
Analysis, AnalysisHost, AnnotationConfig, DiagnosticsConfig, Edition, InlayFieldsToResolve,
|
||||
InlayHintsConfig, LineCol, RootDatabase,
|
||||
};
|
||||
use ide_db::{EditionedFileId, LineIndexDatabase, SnippetCap, base_db::SourceDatabase};
|
||||
use ide_db::{
|
||||
EditionedFileId, LineIndexDatabase, SnippetCap,
|
||||
base_db::{SourceDatabase, salsa::Database},
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use load_cargo::{LoadCargoConfig, ProcMacroServerChoice, load_workspace};
|
||||
use oorandom::Rand32;
|
||||
|
|
@ -104,7 +107,7 @@ impl flags::AnalysisStats {
|
|||
}
|
||||
eprintln!(")");
|
||||
|
||||
let host = AnalysisHost::with_database(db);
|
||||
let mut host = AnalysisHost::with_database(db);
|
||||
let db = host.raw_database();
|
||||
|
||||
let mut analysis_sw = self.stop_watch();
|
||||
|
|
@ -250,6 +253,9 @@ impl flags::AnalysisStats {
|
|||
self.run_term_search(&workspace, db, &vfs, file_ids, verbosity);
|
||||
}
|
||||
|
||||
let db = host.raw_database_mut();
|
||||
db.trigger_lru_eviction();
|
||||
|
||||
let total_span = analysis_sw.elapsed();
|
||||
eprintln!("{:<20} {total_span}", "Total:");
|
||||
report_metric("total time", total_span.time.as_millis() as u64, "ms");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue