Add parsing benchmark

This commit is contained in:
Aleksey Kladov 2021-02-09 21:52:34 +03:00
parent 4b1279d0b1
commit 61f15b72ac
4 changed files with 8628 additions and 8 deletions

View file

@ -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()
}