rii-mango/Daikon

Slow memory allocation and fragmentation occurs in `getInterpolatedData()`

DLiblik opened this issue · 2 comments

getInterpolatedData() allocates its output array one index at a time, resulting in fragmentation and slow performance. This can be fixed by pre-allocating the output array. I did this in PR #11

For more evidence of how much faster pre-declaring the array size is, please see:

https://jsperf.com/preallocating-array/8

Nice, fixed. Thanks for your great additions.