Closed himanshugupta1009 closed 8 months ago
Overall this change looks great to me. I'm surprised dot
was contributing to allocations, but the data does not lie. Thank you!
Could the indentation of the code be adjusted to match with the existing code? Usually that delta is a matter of tabs vs. spaces.
@tawheeler I think the allocation was due to the argument that was being passed to the dot function (data[index]).
I didn't realize the indentation mismatch before. Thank you for pointing it out. I have replaced tabs with spaces and it now matches the existing code.
1) Modified the interpolants function to return a view of grid.index and grid.weight instead of slicing it (gets rid of allocations). 2) Modified the interpolate function to avoid allocation (data[index] was causing allocations).
Performance comparison
Before these modifications
After these modifications
If there are any issues with it, please let me know. Thanks!