performance regression in findfirst
due to inlining #26446
Closed
Description
opened on Mar 13, 2018
julia> a = rand(10000000); z = a[end];
julia> @time findfirst(equalto(z), a)
0.411288 seconds (10.01 M allocations: 153.062 MiB, 36.84% gc time)
In 0.6 there are no allocations. The reason for this is that findfirst
is a simple wrapper for findnext
, and so it does not get specialized on its function argument (since it doesn't call the function itself). However, findnext
is being inlined into it anyway. I don't think we should inline in this case (perhaps whenever the argument types are not is_cacheable_sig
for the target method, and/or because the target method has a loop).
Activity