Note that this will improve considerably with https://github.com/JuliaLang/julia/pull/44186
nightly:
julia> print(" Array: "); @btime cheb!($A, $x)
Array: 225.605 ns (0 allocations: 0 bytes)
julia> print("ReinterpretArray: "); @btime cheb!($B, $x)
ReinterpretArray: 2.839 μs (0 allocations: 0 bytes)
julia> VERSION
v"1.9.0-DEV.411"
This PR:
julia> print(" Array: "); @btime cheb!($A, $x)
Array: 226.522 ns (0 allocations: 0 bytes)
julia> print("ReinterpretArray: "); @btime cheb!($B, $x)
ReinterpretArray: 458.822 ns (0 allocations: 0 bytes)
julia> VERSION
v"1.8.0-DEV.1561"
Wish this PR would get reviewed