Memory Allocation in `@time` but not in `AllocCheck.check_allocs`

It’s not runnable for me because smooth is missing, but this looks like compilation of a runtime dispatch with global variables, which AllocCheck skips because it’s not happening within the method call itself. The Performance Tips mention you can put the @time call inside a timing method to get rid of the allocation, but you could also make a const global like const ys2 = ys; @time mytest(ys2) or interpolate global variables into @btime mytest($ys2) if you have the extra seconds for a more robust benchmark. I’m not familiar with Chairmarks.jl, but it also supports interpolation and it seems like @b ys2 mytest accomplishes the same thing as interpolation.

1 Like