Don’t benchmark in global scope
julia> f1(l) = algorithm_direct(l, x->x, (x, y) -> x == y )
f1 (generic function with 1 method)
julia> @btime f1($Λ)
4.164 ns (0 allocations: 0 bytes)
julia> f2(l) = algorithm(l, x->x, (x, y) -> x == y )
f2 (generic function with 1 method)
julia> @btime f2($Λ)
3.863 ns (0 allocations: 0 bytes)