diff --git a/.github/workflows/Benchmarks.yml b/.github/workflows/Benchmarks.yml new file mode 100644 index 0000000..45dd538 --- /dev/null +++ b/.github/workflows/Benchmarks.yml @@ -0,0 +1,20 @@ +name: Benchmarks +on: + pull_request_target: + branches: [ main ] +permissions: + pull-requests: write + +jobs: + bench: + runs-on: ubuntu-latest + strategy: + matrix: + version: + - 'lts' + - '1' + steps: + - uses: MilesCranmer/AirspeedVelocity.jl@action-v1 + with: + julia-version: ${{ matrix.version }} + bench-on: ${{ github.event.pull_request.head.sha }} \ No newline at end of file diff --git a/benchmark/Project.toml b/benchmark/Project.toml new file mode 100644 index 0000000..62ff9a1 --- /dev/null +++ b/benchmark/Project.toml @@ -0,0 +1,4 @@ +[deps] +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +GeoTables = "e502b557-6362-48c1-8219-d30d308dcdb0" +Meshes = "eacbb407-ea5a-433e-ab97-5258b1ca43fa" diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..11925dd --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,25 @@ +using BenchmarkTools +using GeoStatsModels +using GeoTables +using Meshes + +# auxiliary variables +table1 = (; z=[1.0, 2.0, 3.0]) +table2 = (; z=[missing, 2.0, 3.0]) +coords = [(25.0, 25.0), (50.0, 75.0), (75.0, 50.0)] +data1 = georef(table1, coords) +data2 = georef(table2, coords) +igrid = CartesianGrid(100, 100) +model = Kriging(GaussianVariogram(range=35.0)) + +# initialize benchmark suite +const SUITE = BenchmarkGroup() + +# -------- +# KRIGING +# -------- + +SUITE["kriging"] = BenchmarkGroup() + +SUITE["kriging"]["full"] = @benchmarkable GeoStatsModels.fitpredict($model, $data1, $igrid, neighbors=true) +SUITE["kriging"]["miss"] = @benchmarkable GeoStatsModels.fitpredict($model, $data2, $igrid, neighbors=true)