aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-04 16:04:33 +0100
committerAleksey Kladov <[email protected]>2020-07-04 16:04:33 +0100
commit3902e5574c56a4f0c7e0846afe61022ef4b4fc76 (patch)
treeafb5f2a3b459a463a84b117415b93789bbcf8594
parent000d1db35131238190f3d62e7b100d71e31eb24c (diff)
Add Item change to the set of benches
-rw-r--r--crates/rust-analyzer/src/cli/analysis_bench.rs13
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());