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

Add Benchmarks via PkgBenchmarks #75

Merged
merged 5 commits into from
Nov 10, 2023
Merged

Conversation

tjjarvinen
Copy link
Contributor

@tjjarvinen tjjarvinen commented Nov 8, 2023

This adds Benchmarks with PkgBenchmark.jl.

To use benchmarks you can

using BenchmarkTools
using PkgBenchmark
using Polynomials4ML

bench = benchmarkpkg(Polynomials4ML)
results = bench.benchmarkgroup

# You can search with macro "@tagged"
results[@tagged "derivative"]

To control benchmarks e.g. number of threads

t2 = BenchmarkConfig(env = Dict("JULIA_NUM_THREADS" => 2))
bench_t2 = benchmarkpkg(Polynomials4ML, t2)

To save benchmarks to a file

export_markdown("results.md", bench)

Compare to a different branch - note you need to commit your changes (also both branches need to have same benchmarks)

# current branch to "origin/main"
j = judge(Polynomials4ML, "origin/main")

Automatic benchmarks on pull requests

I added support for BenchmarkCI.jl, so by adding a label "Run Benchmarks" on PR CI will run benchmarks and compare to main branch. (Note this only works after this PR has been merged)

There is also an option to store benchmarks in the repo, but I have commented that out.

You should also be able to add more benchmarks yourself based on the benchmarks.jl file.

@cortner
Copy link
Member

cortner commented Nov 8, 2023

@CheukHinHoJerry -- when you have time, can you please take a look and familiarize yourself with this? If you are happy with this then I'll merge it and then we should make a new PR to add actual benchmarks.

@CheukHinHoJerry
Copy link
Collaborator

Happy for this to be merged as is. Thanks.

@cortner
Copy link
Member

cortner commented Nov 9, 2023

@tjjarvinen -- could you maybe add the instructions to a developer documentation page in the docs? Then I'll go ahead and make the merge.

@cortner
Copy link
Member

cortner commented Nov 10, 2023

Is this ready now?

@tjjarvinen
Copy link
Contributor Author

yes

@cortner cortner merged commit 6c02075 into ACEsuit:main Nov 10, 2023
5 checks passed
@cortner
Copy link
Member

cortner commented Nov 10, 2023

Thank you.

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.

3 participants