imglib / imglib2

A generic next-generation Java library for image processing
http://imglib2.net/
Other
302 stars 93 forks source link

Reduce allocation size for Cell objects in CellImg #345

Closed tpietzsch closed 7 months ago

tpietzsch commented 1 year ago

Each Cell has its own copy of arrays int[] dimensions and int[] steps although they are identical for large groups of cells:

The arrays for each group of cells could be pre-computed (by CellGrid) and re-used.

Possibly, the min[] and max[] arrays could be avoided, and computed on the fly? (from the flattened grid index of the cell) (But there should be a Benchmark to see the impact)