Memory management: stop copying data!
Closed this issue · 0 comments
tBuLi commented
- kingdon version:
- Python version:
- Operating System:
Description
Currently, when creating a new MV instance, we usually copy data around. For example, when initiating from a numpy array, turning this array into the mapping vals
means that copies of the data are created. A possible solution to this is to store the input array as vals
directly, and to turn the MV into a Mapping
using collections.abc
. This way we could convert from the binary key to the proper location in the input sequence and retrieve it when needed. This way no data is copied anymore, and performance should improve accordingly.