Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better codegen for specialized
in(v, ::Tuple)
Since we were already specializing in for Tuples anyway, we should be generating code that can take advantage of the tuple type, rather than doing a generic, type-unstable traversal. Before: ```julia julia> @Btime Base.in($(5), (1, 2.0, 3, "hey", 5.2)) 53.541 ns (6 allocations: 224 bytes) false ``` After: ```julia julia> @Btime Base.in($(5), (1, 2.0, 3, "hey", 5.2)) 1.666 ns (0 allocations: 0 bytes) false ``` The new code statically unrolls the tuple comparisons, and thus also compiles away any of the comparisons that are statically known to be not equal, such as the `==(::Int, ::String)` comparison for element 4 in the example above.
- Loading branch information