Closed
Description
One of the things worth considering is "value dimensions" of an array. This was mentioned here. At one point I considered suggesting that any "value dimension" should just be an immutable (like the immutables of Color), but this issue completely dashes that thought (200,000 fields would be a lot of typing...).
So we are left with 3 potential approaches:
- As suggested in the second bullet point, use Arrays as the element types. One problem:
julia> function f(n)
a = [n]
nothing
end
f (generic function with 1 method)
julia> f(3)
julia> @allocated f(3)
64
That's a lot of memory overhead for an element that only needs 8 bytes.
- Use tuples. That limits us to 1d objects, and currently these too have overhead, but I think not as much as Arrays (it's harder to measure because sometimes they are elided, which is of course nice when it's applicable).
- Add a
ValueDims<:(Int,...)
parameter to theAbstractInterpolation
type. This would encode value dimensions in a way that we could dispatch on them. Of course we'd want to do some simple performance testing before adopting this route. Our metaprogramming would have to be even more generic, generating different versions of the code for different choices of theValueDims
tuple.
Metadata
Metadata
Assignees
Labels
No labels