Skip to content

Conversation

@nsajko
Copy link
Member

@nsajko nsajko commented May 15, 2024

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.

Better type inference example:

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

Example of better effects:

```julia-repl
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 nsajko added the collections Data structures holding multiple items, e.g. sets label May 15, 2024
@nsajko nsajko marked this pull request as draft July 2, 2024 22:01
@nsajko nsajko closed this Jul 14, 2024
@nsajko nsajko deleted the reimplement_findfirst_findlast branch July 14, 2024 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

collections Data structures holding multiple items, e.g. sets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant