This is just a general idea of how we could make our iterator much more efficient.
In the case of fill, the most efficient algorithm would be to copy power of two's and recopying what we've already written into the next chunk to minimize the number of call to Memory.copy. This is not taking into account non-trivially contiguous case.
If the iterator could let us know how many contiguous scalars are coming and have some facilities for jumping ahead, we could do all these nifty tricks.
This is just a general idea of how we could make our iterator much more efficient.
In the case of
fill
, the most efficient algorithm would be to copy power of two's and recopying what we've already written into the next chunk to minimize the number of call toMemory.copy
. This is not taking into account non-trivially contiguous case.If the iterator could let us know how many contiguous scalars are coming and have some facilities for jumping ahead, we could do all these nifty tricks.