aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-02-09 18:52:34 +0000
committerAleksey Kladov <[email protected]>2021-02-09 18:52:34 +0000
commit61f15b72ac52c23148038b3867198597b345e2f6 (patch)
tree0935428e6e79a42da638a5c983ec526c64f10abb /crates/test_utils
parent4b1279d0b160d98c1429ca1a52b37aa7a0af5775 (diff)
Add parsing benchmark
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/bench_fixture.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/test_utils/src/bench_fixture.rs b/crates/test_utils/src/bench_fixture.rs
index 41fcca635..aa1bea9bb 100644
--- a/crates/test_utils/src/bench_fixture.rs
+++ b/crates/test_utils/src/bench_fixture.rs
@@ -1,7 +1,11 @@
1//! Generates large snippets of Rust code for usage in the benchmarks. 1//! Generates large snippets of Rust code for usage in the benchmarks.
2 2
3use std::fs;
4
3use stdx::format_to; 5use stdx::format_to;
4 6
7use crate::project_dir;
8
5pub fn big_struct() -> String { 9pub fn big_struct() -> String {
6 let n = 1_000; 10 let n = 1_000;
7 11
@@ -26,3 +30,8 @@ struct S{} {{
26 30
27 buf 31 buf
28} 32}
33
34pub fn glorious_old_parser() -> String {
35 let path = project_dir().join("bench_data/glorious_old_parser");
36 fs::read_to_string(&path).unwrap()
37}