astrofrog / astrofrog/fast-histogram

Suggestion: memory allocation enhancement

Open
#50 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.