Hi All,
I need to process 2D matrix data in short blocks, for example:
function times_one!(x::SubArray{Float64,2})
@. x= 1.0*x
end
function test(dim_long,dim_short,step)
x= rand(dim_long,dim_short)
@time for i = 1:step:dim_long
times_one!(view(x,i:(i+step-1),:))
end
end
A few test results:
julia> test(8192,4,2);test(8192,4,64)
0.000271 seconds (4.10 k allocations: 256.000 KiB)
0.000030 seconds (128 allocations: 8.000 KiB)
It seems that the memory usage reported by @time is directly proportional to the inverse of the step size, which is the dominant effect on the run-time. Whilst these numbers and functions are of course only for example, this looks to be the dominant performance limitation in my code base.
What are some possible workarounds? I canāt avoid calling my library in small blocks.
Kind Regards,
Peter.