GridInterpolations.jl icon indicating copy to clipboard operation
GridInterpolations.jl copied to clipboard

Allocation Tests

Open zsunberg opened this issue 1 year ago • 3 comments

This PR adds some allocation tests. Unfortunately they were failig.

zsunberg avatar Jul 11 '24 04:07 zsunberg

@himanshugupta1009 didn't we get allocations down to zero with #42? I can't seem to reproduce the no-allocations

zsunberg avatar Jul 11 '24 04:07 zsunberg

I think the issue is that MArrays are sometimes allocated to the heap and sometimes allocated to the stack: https://stackoverflow.com/questions/74793823/mutable-data-types-that-use-stack-allocation

So the allocation tests seem to pass in some cases and fail in others, at least when I was trying it.

Unless there's some way to do the calculation with static arrays, the only thing I can think of is to add an interpolate!() method that that takes an object holding those MArrays as an argument, and another function that initializes those arrays. So then you could do the allocation ones and reuse the arrays a lot of times. Is that something there would be interest in?

ctessum avatar Jul 11 '24 06:07 ctessum

Discussion continued in #51

zsunberg avatar Jul 11 '24 16:07 zsunberg