This is a follow-up of this discussion in discourse.
Multiplication of intervals in functions defined inside a module leads to 6 extra allocations per *. Interestingly, redefining the function in the REPL fixes the issue.
Here is a MWE:
module MyModule
foo(x) = x*x
export foo
end
using .MyModule, IntervalArithmetic, BenchmarkTools
x = @interval(π);
@btime foo(Ref($x)[]);
# 137.597 ns (6 allocations: 96 bytes)
MyModule.foo(x) = x*x
@btime foo(Ref($x)[]);
# 59.040 ns (0 allocations: 0 bytes)