astrofrog / astrofrog/fast-histogram
Suggestion: memory allocation enhancement
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 281
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Hi, Thomas
First of all, thank you for the package, it's really handy.
However, I have a particular problem that might require an additional modification of the code.
I have to calculate a lot of histograms (starting from the trivial case with one bin only and up to probably 10^6 bins) using the same grid but passing different sets of data. That means constant allocations of memory whereas it is possible to do this once and just keep clearing the array.
Is it potentially possible to implement this?
V.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is named. Start by locating the package's 1D and 2D histogram entry points and tracing where repeated calls allocate their output arrays. Define how callers would request reuse and how clearing should behave, then add coverage or benchmarks showing repeated histogram calculations avoid unnecessary allocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100