Skip to content

Commit

Permalink
test: add benchmark for moffat init (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Jan 29, 2025
1 parent a946ce3 commit 7a2fffc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/jax/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,15 @@ def test_benchmark_invert_ab_noraise(benchmark, kind):
lambda: _run_benchmark_invert_ab_noraise(u, v, ab).block_until_ready(),
)
print(f"time: {dt:0.4g} ms", end=" ")


def _run_benchmark_moffat_init():
return jgs.Moffat(beta=2.5, half_light_radius=0.6, trunc=1.2).scale_radius


@pytest.mark.parametrize("kind", ["compile", "run"])
def test_benchmark_moffat_init(benchmark, kind):
dt = _run_benchmarks(
benchmark, kind, lambda: _run_benchmark_moffat_init().block_until_ready()
)
print(f"time: {dt:0.4g} ms", end=" ")

0 comments on commit 7a2fffc

Please sign in to comment.