mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Add parsing benchmark
This commit is contained in:
parent
4b1279d0b1
commit
61f15b72ac
4 changed files with 8628 additions and 8 deletions
|
@ -1,7 +1,11 @@
|
|||
//! Generates large snippets of Rust code for usage in the benchmarks.
|
||||
|
||||
use std::fs;
|
||||
|
||||
use stdx::format_to;
|
||||
|
||||
use crate::project_dir;
|
||||
|
||||
pub fn big_struct() -> String {
|
||||
let n = 1_000;
|
||||
|
||||
|
@ -26,3 +30,8 @@ struct S{} {{
|
|||
|
||||
buf
|
||||
}
|
||||
|
||||
pub fn glorious_old_parser() -> String {
|
||||
let path = project_dir().join("bench_data/glorious_old_parser");
|
||||
fs::read_to_string(&path).unwrap()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue