Thanks. Here is the complete code I am running. It is actually just the LinearAlgebra and the BenchmarkTools missing
using LinearAlgebra
using BenchmarkTools
function testfun02(M)
nrow, ncol = size(M);
spidx = Array{Float64, 2}(undef, nrow, 3)
numit = 1
for j01 = 1:ncol, j02 = 1:nrow
aval = M[j02,j01]*(j01+j02)
if aval > 0
spidx[numit,1] = j01
spidx[numit,2] = j02
spidx[numit,3] = aval
numit += 1
end
end
return spidx
end
B = Array{Float64,2}(I, 10000, 10000);
benchout = @benchmark testfun02(B);
@time testfun02(B);
@time testfun02(B);
The Output is
@time testfun02(B);
0.111525 seconds (27.23 k allocations: 1.895 MiB, 17.53% compilation time)
@time testfun02(B);
0.096936 seconds (2 allocations: 234.453 KiB)
The version info is
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =
and that looks indeed strange.