Skip to content

Multi-valued interpolation #3

Closed
@timholy

Description

@timholy

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:

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 the AbstractInterpolation 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 the ValueDims tuple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions