Skip to content

Implement cached memory in eventmgr #5154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

spxiwh
Copy link
Contributor

@spxiwh spxiwh commented Jul 8, 2025

This patch continues to work on optimizations on pyGRB (following #5148). This is a bit more invasive than other things. It was noticed in 5148 that resizing output arrays in eventmgr was a considerable cost in pyGRB. This can be fixed by implementing cached memory (rather than repeatedly using numpy.append and throwing away arrays when done). In this model we store the array (larger than the triggers stored in it) and the current valid size, and keep track of both together. Only if the number of valid triggers exceeds the size of the array do we resize and then we stick at the new size.

Standard information about the request

This is a: efficiency update,

This change affects: the offline search, PyGRB

This change changes: output

This change: has appropriate unit tests, follows style guidelines (See e.g. PEP8), has been proposed using the contribution guidelines

This change will: [hopefully] be transparent to the user.

Motivation

To make pyGRB more efficient.

Contents

We rework memory management in eventmgr for all classes.

Links to any issues or associated PRs

#5148

Testing performed

I've run the multi_inspiral example with this (coupled with #5153). Need to see it pass the test suite here next.

  • [./ ] The author of this pull request confirms they will adhere to the code of conduct

@pannarale pannarale added the PyGRB PyGRB development label Jul 11, 2025
@github-project-automation github-project-automation bot moved this to In Progress in PyGRB Development Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PyGRB PyGRB development
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants