Skip to content

Make use of ArrayPool<T> to reduce memory allocs for neural net arrays. #48

@colgreen

Description

@colgreen

When we decode a genome to a neural net we tend to allocate a few arrays. It would be good to try and use ArrayPool (probably, actually MemoryPool.Shared ?) where possible to minimise allocation and GC activity.

This work can be guided by the memory and GC tracking info from the performance profiler - we can use the efficacy sampler project to generate the workload for this.

Using arrays from a pool also means we avoid the memory clearing/zeroing overhead that occurs when getting a new array from the heap.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions