From 3902e5574c56a4f0c7e0846afe61022ef4b4fc76 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 4 Jul 2020 17:04:33 +0200 Subject: [PATCH] Add Item change to the set of benches --- crates/rust-analyzer/src/cli/analysis_bench.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs index 3730d346c10..90990d3e77d 100644 --- a/crates/rust-analyzer/src/cli/analysis_bench.rs +++ b/crates/rust-analyzer/src/cli/analysis_bench.rs @@ -134,6 +134,19 @@ fn do_work T, T>(host: &mut AnalysisHost, file_id: FileId, w work(&host.analysis()); eprintln!("{:?}", start.elapsed()); } + { + let start = Instant::now(); + eprint!("item change: "); + { + let mut text = host.analysis().file_text(file_id).unwrap().to_string(); + text.push_str("\npub fn _dummy() {}\n"); + let mut change = AnalysisChange::new(); + change.change_file(file_id, Some(Arc::new(text))); + host.apply_change(change); + } + work(&host.analysis()); + eprintln!("{:?}", start.elapsed()); + } { let start = Instant::now(); eprint!("const change: ");