Hi Daniel, Thanks for the reply. Are your suggesting mat[:,1] is making a copy of the entire matrix in the current version of Julia? I also tested the following code, for 10^4 times since each loop takes only a small amount of time:
@time for i in 1:10000;v=dtm[:,1]; w=dtm[:,2];end # elapsed time: 0.011027003 seconds (17760000 bytes allocated) -- Todd On Monday, November 10, 2014 2:34:01 PM UTC+8, Daniel Høegh wrote: > > I think the reason why it is slow is due to indexing is making a copy of > your data and not passed by reference as in python. This behavior is going > to change in 0.4 where subarrays is introduced then the data is not copied. > > You could try it by. > @time v=mat[:,1]; w=mat[:,2] > This should take long time and allocate a lot of memory. >
