Open DNF2 opened 1 month ago
It looks like the thing that pushes it over the inlining threshold is the (unnecessary) check
if length(a) != length(xs)
throw(ArgumentError("argument count does not match specified shape (expected $(length(a)), got $(length(xs)))"))
end
This check is unnecessary since if the length doesn't match, one of the rows won't match, but it still adds 40 to the inlining cost. Interestingly, https://github.com/JuliaLang/julia/pull/55913 also solves this since it makes the array construction better understood (and therefore cheaper for the inliner)
As discussed in this Discourse thread: https://discourse.julialang.org/t/strange-performance-of-literal-array-constructor/121575/1 performance is off for
typed_hvcat
.Performance is regained with
@inline
: