Open
Description
This code used to be allocation-free in julia-1.10
but is not anymore in julia-1.11
:
using BenchmarkTools
fmap(fs, x...) = _fmap(x, fs...)
@inline _fmap(x, f, fs...) = (f(x...), _fmap(x, fs...)...)
@inline _fmap(x) = ()
fs = (hypot, atand)
x = 3
y = 4
@btime fmap($fs, $x, $y);
Julia v1.10.8: 51.022 ns (0 allocations: 0 bytes)
Julia v1.11.4: 191.837 ns (3 allocations: 64 bytes)
(The allocations are also observed in julia v1.12.0-beta1: 199.714 ns (3 allocations: 64 bytes)
)
Is this something that would need to be addressed in the julia source code or can this be avoided by small tweaks to the code? Any help is very much appreciated.