Hm… so am I doing something wrong?
Julia Version 1.9.3
Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 1 on 8 virtual cores
Even in 1.9.3. I have:
julia> @btime my_sum($x)
61.876 ns (0 allocations: 0 bytes)
500.0120162080791
julia> @btime my_sum_debug($x)
479.487 ns (2 allocations: 112 bytes)
500.0120162080791