Skip to content

Gridded PSF performance improvement#2289

Open
keflavich wants to merge 1 commit into
astropy:mainfrom
keflavich:gridded-psf-fastpath
Open

Gridded PSF performance improvement#2289
keflavich wants to merge 1 commit into
astropy:mainfrom
keflavich:gridded-psf-fastpath

Conversation

@keflavich
Copy link
Copy Markdown
Contributor

This PR attempts to improve performance of GriddedPSF evaluation.

At a low level, some of these steps get ~10x speedups. However, I think they contribute negligibly to overall speed for most cases, so I'm not sure we should merge this - the slight cost in code complexity may be not worth it.

Evaluating this PR requires tests against a new benchmark:
astropy/photutils-benchmarks#5

Low-level improvement:

Test: 4x4 PSF grid, 51-pixel stamps, 2x oversampling, 10,000 evaluate calls

| Operation | Before (us) | After (us) | Speedup |
|-----------|------------|-----------|---------|
| `_find_bounding_points` | 159.52 | 13.11 | **12.17x** |
| `_calc_bilinear_weights + bounding` | 228.72 | 20.75 | **11.02x** |
| `evaluate()` full | 626.39 | 545.66 | **1.15x** |

If this 15% improvement really holds up on realistic cases, it's... maybe worthwhile?

Claude Haiku 4.5 contributed a bunch to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant