-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f43c6e
commit 8867987
Showing
4 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Benchmark Tracking | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
deployments: write | ||
|
||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: '1' | ||
arch: x64 | ||
- uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-artifacts | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- name: Run benchmark | ||
run: | | ||
cd benchmarks | ||
julia --project --threads=2 --color=yes -e ' | ||
using Pkg; | ||
Pkg.develop(PackageSpec(path=joinpath(pwd(), ".."))); | ||
Pkg.instantiate(); | ||
include("runbenchmarks.jl")' | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: Julia benchmark result | ||
tool: "julia" | ||
output-file-path: benchmarks/benchmarks_output.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: ${{ github.event_name != 'pull_request' }} | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: "200%" | ||
comment-on-alert: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: "@ktrz,@findmyway" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/benchmarks_output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using BenchmarkTools | ||
using QuantumToolbox | ||
|
||
fib(n) = n <= 1 ? 1 : fib(n - 2) + fib(n - 1) | ||
|
||
suite = BenchmarkGroup() | ||
|
||
suite["steadystate"] = BenchmarkGroup(["steadystate"]) | ||
|
||
|
||
## steadystate ## | ||
|
||
N = 50 | ||
Δ = 0.1 | ||
F = 2 | ||
γ = 1 | ||
a = destroy(N) | ||
H = Δ * a' * a + F * (a + a') | ||
c_ops = [sqrt(γ) * a] | ||
|
||
suite["steadystate"]["driven-dissipative harmonic oscillator"] = @benchmarkable steadystate($H, $c_ops) | ||
|
||
## end ## | ||
|
||
|
||
tune!(suite) | ||
results = run(suite, verbose = true) | ||
|
||
BenchmarkTools.save("benchmarks_output.json", mean(results)) |