Are you sure those aren’t culprits? Because if I change obj = form(fill(0.0, 10)) to
const obj = form(fill(0.0, 10))
or
obj::Test1 = form(fill(0.0, 10))
or
let obj = form(fill(0.0, 10))
@time solve(obj)
end
Then the time reported is back to
0.000003 seconds (1 allocation: 144 bytes)
All in a new session, and without removing any methods of solve.
This suggests something about module scope is making obj more dynamic than one might expect. Without const, a type assertion (i.e. “typed global” syntax) or forcing it to be a local variable, the behaviour we observe is very similar to what happens when referencing global variables.