diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-09 18:53:27 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-09 18:53:27 +0000 |
commit | 4f9a5287bfea124b76571424ce3eb4a91aec337a (patch) | |
tree | cfe365b8382bfae9f8d0bfc9ebc9c35cc6e58307 /crates/test_utils | |
parent | 96a9ab725093b5f6501ed086973906ebb77805ff (diff) | |
parent | 61f15b72ac52c23148038b3867198597b345e2f6 (diff) |
Merge #7615
7615: Add parsing benchmark r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/test_utils')
-rw-r--r-- | crates/test_utils/src/bench_fixture.rs | 9 |
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 | ||
3 | use std::fs; | ||
4 | |||
3 | use stdx::format_to; | 5 | use stdx::format_to; |
4 | 6 | ||
7 | use crate::project_dir; | ||
8 | |||
5 | pub fn big_struct() -> String { | 9 | pub 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 | |||
34 | pub fn glorious_old_parser() -> String { | ||
35 | let path = project_dir().join("bench_data/glorious_old_parser"); | ||
36 | fs::read_to_string(&path).unwrap() | ||
37 | } | ||