Benchmarks

The benchmarks can be found in the bench/ folder. To run them, first instantiate the environment

$ julia --project=bench -e "using Pkg; Pkg.instantiate()"

then execute the bench/bench.jl file

$ julia --project=bench bench/bench.jl

System Information

Julia Version 1.12.4
Commit 01a2eadb047 (2026-01-06 16:56 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × 13th Gen Intel(R) Core(TM) i5-1340P
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, alderlake)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 16 virtual cores)

Evaluation benchmark

This benchmark tests how long it takes to evaluate a single point in the PSF model. This may seem contrived, but we expect performance to scale directly from this measure: if it takes 1 microsecond to evaluate a single point, it should take ~1 second to evaluate a 1000×1000 image, with speedups potentially from multithreading or SIMD loop evaluation.

table = CSV.read(benchdir("evaluation_results.csv"), DataFrame)
3×3 DataFrame
 Row │ name      psfmodels   astropy
     │ String15  Float64     Float64
─────┼─────────────────────────────────
   1 │ Gaussian  1.06293e-8  5.4746e-5
   2 │ AiryDisk  2.97278e-8  4.6085e-5
   3 │ Moffat    2.23648e-8  3.818e-5
@df table groupedbar(
    :name, [:psfmodels :astropy];
    ylabel="time (s)", yscale=:log10, legend=:outertopright,
    label=["PSFModels.jl" "Astropy"], size=(500, 300),
)
Example block output

Fitting benchmark

This benchmark tests how long it takes to fit a PSF Model to a stamp with size (39, 39). In all cases, we use equivalently complex models, the default fitters for PSFModels.jl, and the default LevMarLSQFit fitter for astropy.

table = CSV.read(benchdir("fitting_results.csv"), DataFrame)
3×3 DataFrame
 Row │ name      psfmodels   astropy
     │ String15  Float64     Float64
─────┼──────────────────────────────────
   1 │ Gaussian  0.00335446  0.00404464
   2 │ AiryDisk  0.00253383  0.00482356
   3 │ Moffat    0.00419497  0.00531061
@df table groupedbar(
    :name, [:psfmodels :astropy];
    ylabel="time (s)", yscale=:log10, legend=:outertopright,
    label=["PSFModels.jl" "Astropy"], size=(500, 300),
)
Example block output