Creating SVector of a single SVector{1, Float64}

This is a benchmarking artifact from not interpolating the variables:

julia> x = SVector{2,Float64}(1,1)
2-element SVector{2, Float64} with indices SOneTo(2):
 1.0
 1.0

julia> @benchmark SA[$x]
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
 Range (min … max):  1.538 ns … 7.332 ns  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     1.551 ns             ┊ GC (median):    0.00%
 Time  (mean ± σ):   1.558 ns ± 0.098 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

     ▁▃▇█▆▄                                                  
  ▂▄▇██████▃▂▂▂▂▂▁▁▂▂▂▂▂▂▂▂▂▁▁▁▁▁▂▁▁▁▂▂▂▂▂▂▂▁▁▁▁▁▁▁▁▁▂▂▂▂▂▂ ▃
  1.54 ns        Histogram: frequency by time       1.66 ns <

 Memory estimate: 0 bytes, allocs estimate: 0.

julia> @benchmark SVector{1,SVector{2,Float64}}($x)
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
 Range (min … max):  1.751 ns … 4.871 ns  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     1.766 ns             ┊ GC (median):    0.00%
 Time  (mean ± σ):   1.783 ns ± 0.128 ns  ┊ GC (mean ± σ):  0.00% ± 0.00%

      █▇▇▆                                                   
  ▂▂▃▅████▃▂▂▂▂▂▂▁▂▂▂▂▃▄▄▄▂▂▂▂▂▁▁▁▁▁▂▂▂▂▂▂▂▂▂▂▁▁▁▁▂▁▁▁▁▁▁▂▂ ▃
  1.75 ns        Histogram: frequency by time       1.89 ns <

 Memory estimate: 0 bytes, allocs estimate: 0.

Concerning the original question, that is either a bug or some limitation introduced by internals of the representations. I would report it.

1 Like