astrofrog / fast-histogram

:zap: Fast 1D and 2D histogram functions in Python :zap:
BSD 2-Clause "Simplified" License
267 stars 28 forks source link

Suggestion: memory allocation enhancement #50

Open vkhodygo opened 4 years ago

vkhodygo commented 4 years ago

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.