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

Specialize certain operations for Static.jl

Open oschulz opened this issue 3 years ago • 0 comments

Derived from #176 and #104

@dlfivefifty: I would say a better solution may be to just support Fill{StaticInt}, etc.

Taking on Static.jl as a dependency would open up interesting possibilities. For example, we could specialize vcat (related to #140) to get:

vcat(Fill(static(4.2), 5), Fill(static(4.2), 5)) === Fill(static(4.2), 10)

Static.jl is a lightweight dependency on top of FillArrays, load-time impact would probably be minor (needs to be tested, of course):

julia> @time using FillArrays
  0.398913 seconds (764.83 k allocations: 46.937 MiB, 72.11% compilation time)

julia> @time using Static
  0.062017 seconds (93.65 k allocations: 5.420 MiB)

oschulz avatar Apr 06 '22 11:04 oschulz