Hi all, I found a strange problem about a very simple code in julia and 
hopefully I can get some help from you, here is the code:


B=[1:1000]

T=zeros(Int64,1000)

for i=1:1000

        @time T[i]=B[i]

        println(T[i])

end


And when I run the code, the @time shows that it require 48 bytes allocation 
when i is larger than or equal to 512, and 0 bytes when smaller. Is this a 
problem that can be improved or I have to accept that it is designed to take 
some allocations when larger than 512? 


Thanks a lot for your help!

 

Reply via email to