But now Julia is too clever, and in ways I don’t actually understand, and I’m struggling to cook up a simple example for complete beginners that is this effective. (The old favourite mandel.jl, which is not simple but cool, is also not complicated enough in Julia 1.6 to demonstrate JIT).
This is because @time macro forces compilation before timing starts. You can try directly calling time().
julia> t = time(); add(1,2); time() - t
0.006040096282958984
julia> t = time(); add(1,2); time() - t
0.00031280517578125
julia> t = time(); add(1,2+im); time() - t
0.13146090507507324
julia> t = time(); add(1,2+im); time() - t
0.00032591819763183594