using BenchmarkTools
unzip1(v) = tuple((([t[j] for t in v]) for j in 1:length(v[1]))...)
unzip2(v) = map(x->getfield.(v, x), fieldnames(eltype(v)))
main() = begin
a = [Tuple(rand(3)) for _ ∈ 1:1_000_000]
@btime unzip1($a)
@btime unzip2($a)
end
main()
output
41.424 ms (6 allocations: 22.89 MiB)
37.375 ms (6 allocations: 22.89 MiB)
Fix https://github.com/JuliaPlots/Plots.jl/issues/4146.
performance
output
We need more unit tests in
RecipesPipeline.jl
!nightly
failure is unrelated.