julia icon indicating copy to clipboard operation
julia copied to clipboard

reimplement the recursive impls of `findfirst`, `findlast`

Open nsajko opened this issue 1 year ago • 0 comments

Better type inference example:

julia> Core.Compiler.return_type(Base._findlast_rec, Tuple{typeof(_ -> rand(Bool)),Tuple})
Union{Nothing, Int64}

Example of better effects:

julia> Base.infer_effects(Base._findlast_rec, Tuple{typeof(Returns(true)),Tuple{Vararg{Any,50}}})
(+c,+e,+n,+t,+s,?m,+u)

julia> Base.infer_effects(Base._findlast_rec, Tuple{typeof(Returns(false)),Tuple{Vararg{Any,50}}})
(+c,+e,+n,+t,+s,?m,+u)

FTR, this PR is part of a series of changes which (re)implement many of the operations on tuples using a new recursive technique. The ultimate goal is to hopefully increase the value of the loop-vs-recurse cutoff (Any32, sometimes hardcoded 32) for tuple operations.

nsajko avatar May 15 '24 18:05 nsajko