Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create initial benchmark. #878

Merged
merged 5 commits into from
May 30, 2020
Merged

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented May 29, 2020

Following up on #867, a first attempt to create a benchmark for the largest file in Fantomas.

So this works on my machine ™, how do we want to run this on CI?
It took around 30 min to run so I'm not sure we want to have this for each PR build.

image

@jindraivanek
Copy link
Contributor

works on my machine ™

Interesting, I got
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\dev\github\fantomas\src\Fantomas.Benchmarks\bin\Release\netcoreapp3.1\c1cfcd54-1773-4652-b944-12f39eec3430\bin\Release\netcoreapp3.1\paket-files\fsprojects\fantomas\src\Fantomas\CodePrinter.fs'.

let path = __SOURCE_DIRECTORY__ + "/../../paket-files/fsprojects/fantomas/src/Fantomas/CodePrinter.fs" fixes it.

@nojaf
Copy link
Contributor Author

nojaf commented May 29, 2020

works on my machine ™

@jindraivanek, hmm yeah that might have been a lie there 🙈

I'm thinking about pushing the results of the benchmark to Azure, in Application Insights.
That might be an easy way to dump the result and query the progress.

@baronfel
Copy link
Contributor

baronfel commented May 29, 2020

I found a github action that does easy performance comparisons over time for perf tests: https://github.com/rhysd/github-action-benchmark

It doesn't currently have support for benchmark.net, but it looks very easy to add support. We'd just have to PR a benchmark.net-specific parsing function for the generated files right here. I mostly am pointing this out because I see that your current CI setup is github-actions-centric.

@baronfel
Copy link
Contributor

Regarding the overall speed of running the tests, I'd say the most impactful things to do would be to lower the amount of warming up/pre-work measurement that's done. Benchmark.net actually does a ton of additional work before running your tests to determine what sorts of jitter/constant factors to account for in your tests. Then, once the warmup is done it does your tests a large number of times.

Therefore you can speed up the iterations by

  • reducing the warmup count
  • reducing the number of times your tests are run to get averages.

@7sharp9
Copy link
Member

7sharp9 commented May 29, 2020

I think you can tweak the attributes so that not as many tests are done so the CI would run faster. the memory one does do a lot of iterations.

@nojaf nojaf merged commit e0d629a into fsprojects:master May 30, 2020
@nojaf
Copy link
Contributor Author

nojaf commented May 30, 2020

CI now runs between nine and elven minutes. Results are stored in Azure Table Storage.
I'm merging to master to see if the data gets pushed (Github actions doesn't allow usage of secrets on PR).

@nojaf nojaf deleted the add-performance-tests branch December 11, 2020 13:27
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.

None yet

4 participants