Skip to content

Commit 3902e55

Browse files
committed
Add Item change to the set of benches
1 parent 000d1db commit 3902e55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/rust-analyzer/src/cli/analysis_bench.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,19 @@ fn do_work<F: Fn(&Analysis) -> T, T>(host: &mut AnalysisHost, file_id: FileId, w
134134
work(&host.analysis());
135135
eprintln!("{:?}", start.elapsed());
136136
}
137+
{
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+
}
137150
{
138151
let start = Instant::now();
139152
eprint!("const change: ");

0 commit comments

Comments
 (0)