From 61f15b72ac52c23148038b3867198597b345e2f6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Feb 2021 21:52:34 +0300 Subject: Add parsing benchmark --- crates/test_utils/src/bench_fixture.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crates/test_utils') 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 @@ //! 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() +} -- cgit v1.2.3