Skip to content

Optimize search loop#259

Merged
larskuenkel merged 6 commits into
mainfrom
optimize_search_loop_njit
Jul 14, 2026
Merged

Optimize search loop#259
larskuenkel merged 6 commits into
mainfrom
optimize_search_loop_njit

Conversation

@larskuenkel

Copy link
Copy Markdown
Contributor

This PR optimizes the search loop, by

  • Using shared memory for all arrays used in the search loop
  • Use njit for performing the harmonic summing. In my earlier test of njit I only used it to gather the values needed for the sum but when I also use it for performing the sum, I see a performance boost.

I am not how much memory pressure this now creates, compared to the previous scheme, so I am not sure how the overall gain is but it should be a bit faster, especially when using more cores.

@larskuenkel

larskuenkel commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Some benchmark plots where I run the search step. I tested for a spectrum with max DM ~1600 which would be processed in our curretn scheme with 30 threads.

I test the new scheme against the old scheme and just using shared memory.

sps-compute1 tests
image
image
image
image
sps-compute4 tests
image
image
image

The new method takes about ~30-50% of the time of the old method.
Interestingly enough, especially for the newer node, using more threads will increase used memory bandwidth while only improving the processing time marginally. This may mean, that we want to cap the the maximum number of threads in some upcoming PR.

I should not that there were not many actual detections in this spectrum. So the time measured here is mostly just performing the harmonic summing, while further processing is limited.

@larskuenkel
larskuenkel merged commit 780df7b into main Jul 14, 2026
5 checks passed
@larskuenkel
larskuenkel deleted the optimize_search_loop_njit branch July 14, 2026 18:37
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