Implement cached memory in eventmgr #5154
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.