Open artemsolod opened 11 months ago
Zip(x, y) allocates a lot in a simple use case (foo). Zip(x) with a single argument seems ok. System: julia 1.9.3, Transducers v0.4.78, Ubuntu
Zip(x, y)
foo
Zip(x)
julia> using Transducers, BenchmarkTools julia> foo(vals) = vals |> Zip(Map(identity), Map(identity)) |> collect foo (generic function with 1 method) julia> vals = collect(1:10_000); julia> @btime foo($vals); # Zip(x, y) 6.014 ms (150060 allocations: 5.22 MiB) julia> foo1(vals) = vals |> Zip(Map(identity)) |> collect foo1 (generic function with 1 method) julia> @btime foo1($vals); # Zip(x) 205.577 μs (17 allocations: 326.78 KiB)
Zip(x, y)
allocates a lot in a simple use case (foo
).Zip(x)
with a single argument seems ok. System: julia 1.9.3, Transducers v0.4.78, Ubuntu