Is there a way to avoid allocating memory when using Chain.jl or pipeing? Technically these are type stable and can mutate the original array to avoid allocation
julia> @time @chain x begin
_ * 1
end;
0.002212 seconds (2 allocations: 7.629 MiB)
julia> @time @chain x begin
_ * 1
_ * 1
end;
0.008802 seconds (4 allocations: 15.259 MiB)
Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message ) (More Info)