diff options
-rw-r--r-- | crates/rust-analyzer/src/cli/analysis_bench.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index 3730d346c..90990d3e7 100644 --- a/crates/rust-analyzer/src/cli/analysis_bench.rs +++ b/crates/rust-analyzer/src/cli/analysis_bench.rs | |||
@@ -136,6 +136,19 @@ fn do_work<F: Fn(&Analysis) -> T, T>(host: &mut AnalysisHost, file_id: FileId, w | |||
136 | } | 136 | } |
137 | { | 137 | { |
138 | let start = Instant::now(); | 138 | let start = Instant::now(); |
139 | eprint!("item change: "); | ||
140 | { | ||
141 | let mut text = host.analysis().file_text(file_id).unwrap().to_string(); | ||
142 | text.push_str("\npub fn _dummy() {}\n"); | ||
143 | let mut change = AnalysisChange::new(); | ||
144 | change.change_file(file_id, Some(Arc::new(text))); | ||
145 | host.apply_change(change); | ||
146 | } | ||
147 | work(&host.analysis()); | ||
148 | eprintln!("{:?}", start.elapsed()); | ||
149 | } | ||
150 | { | ||
151 | let start = Instant::now(); | ||
139 | eprint!("const change: "); | 152 | eprint!("const change: "); |
140 | host.raw_database_mut().salsa_runtime_mut().synthetic_write(Durability::HIGH); | 153 | host.raw_database_mut().salsa_runtime_mut().synthetic_write(Durability::HIGH); |
141 | let res = work(&host.analysis()); | 154 | let res = work(&host.analysis()); |