Skip to content

Conversation

edwin0cheng
Copy link
Contributor

This PR add more real world tests dumped from rust-analyzer analysis-stats . to benchmark its performance.

cc #7513

r? @matklad

@edwin0cheng
Copy link
Contributor Author

CI had passed. I forgot I have to ignore some tidy tests in test fixtures :)

@matklad
Copy link
Contributor

matklad commented Feb 5, 2021

Hm, 6mb file seems a bit excessive to keep in git repo 🤣

It was generated by some code, right? Lets' maybe ignore this file via .gitignore, but commit the code to create it. So that benchmargks look like this:

#[test]
fn benchmark_foo() {
    if skip_slow_tests() { return; }
    // Uses Once to create `target/bench_data/lotsofrust.rs`
    let bf = BenchmarkFixtures::new();
    let file: String = bf.get("many-macros.rs").
}

I think it does make sense to write to disk, so that benchmark generation doesn't affect profiles

@edwin0cheng
Copy link
Contributor Author

Its generated by some hacky awk scripts and adhoc dbg output... but well, I agree that it is too large :)

Let me try to write a proper generation code and see how’s it is.

@edwin0cheng
Copy link
Contributor Author

Instead of a large file for macro invocation fixtures, I am able to generate invocations from MacroRules. The generate code itself is quite fast (and dirty) so I decided no need to write it back to disk.

It is ready to review again :)

@matklad
Copy link
Contributor

matklad commented Feb 27, 2021

bors r+

Nice!

@bors
Copy link
Contributor

bors bot commented Feb 27, 2021

@bors bors bot merged commit a8cf346 into rust-lang:master Feb 27, 2021
@edwin0cheng edwin0cheng deleted the mbe-benchmark branch February 27, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants