On Sunday, April 10, 2016 09:03:06 AM Fred wrote:
> A huge size difference ! I have to read my array from data file so I
> suppose it is like Y and X is only for simulations ?

There turn out to be many situations in which you can take shortcuts if you 
know the values are sorted in increasing order with no skips in them. For 
example, a[1:5] has better performance than a[[1:5;]], even though they yield 
the same answer. One of julia's strengths is that you can leverage this 
knowledge very effectively. So don't convert to an array unless you have some 
reason that you want/need to.

But yes, any data you read from a data file will likely be an array.

Best,
--Tim

> 
> Le dimanche 10 avril 2016 17:50:02 UTC+2, Tim Holy a écrit :
> > Just FYI:
> > 
> > julia> x = 1:0.1:1000000
> > 1.0:0.1:1.0e6
> > 
> > julia> y = collect(x);  # this is the same as y = [x;]
> > 
> > julia> sizeof(x)
> > 32
> > 
> > julia> sizeof(y)
> > 79999928
> > 
> > --Tim

Reply via email to