mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Add Item change to the set of benches
This commit is contained in:
parent
000d1db351
commit
3902e5574c
1 changed files with 13 additions and 0 deletions
|
@ -134,6 +134,19 @@ fn do_work<F: Fn(&Analysis) -> T, T>(host: &mut AnalysisHost, file_id: FileId, w
|
||||||
work(&host.analysis());
|
work(&host.analysis());
|
||||||
eprintln!("{:?}", start.elapsed());
|
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();
|
let start = Instant::now();
|
||||||
eprint!("const change: ");
|
eprint!("const change: ");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue