Skip to content

Commit a8b84c9

Browse files
Add benchmark action (#1221)
* Add benchmark action * Refactor benchmarks.jl * Fix annoying performance test on MacOS * Update .github/workflows/Benchmarks.yml Co-authored-by: Joshua Lampert <[email protected]> --------- Co-authored-by: Joshua Lampert <[email protected]>
1 parent eef36f1 commit a8b84c9

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

.github/workflows/Benchmarks.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Benchmarks
2+
on:
3+
pull_request_target:
4+
branches: [ master ]
5+
permissions:
6+
pull-requests: write
7+
8+
jobs:
9+
bench:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
version:
14+
- 'lts'
15+
- '1'
16+
steps:
17+
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
18+
with:
19+
julia-version: ${{ matrix.version }}
20+
bench-on: ${{ github.event.pull_request.head.sha }}

benchmark/benchmarks.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using BenchmarkTools
2+
using Meshes
3+
4+
const SUITE = BenchmarkGroup()
5+
6+
# ---------
7+
# CLIPPING
8+
# ---------
9+
10+
SUITE["clipping"] = BenchmarkGroup()
11+
12+
s1 = Sphere((0, 0), 1)
13+
s2 = Sphere((1, 0), 1)
14+
r1 = Ring([s1(t) for t in 0.1:0.1:1.0])
15+
r2 = Ring([s2(t) for t in 0.1:0.1:1.0])
16+
17+
SUITE["clipping"]["SutherlandHodgman"] = @benchmarkable clip($r1, $r2, SutherlandHodgmanClipping())

test/predicates.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ end
594594
b2 = Box(cart(2, 2), cart(5, 5))
595595
@test intersects(b1, b2)
596596
@test intersects(b2, b1)
597-
@test @elapsed(intersects(b1, b2)) < 5e-5
597+
@test @elapsed(intersects(b1, b2)) < 1e-4
598598
@test @allocated(intersects(b1, b2)) < 100
599599

600600
# partial application

0 commit comments

Comments
 (0)