You're making a good point about an Array being sometimes faster than a 
LinSpace. But a LinSpace gets you a factor N improvement in terms of memory 
efficiency for a size N range, an Array only gets you a constant factor 
improvement in speed (the factor 15 being admittedly relatively large in 
this example).

Memory efficiency typically matters more for usability in an exploratory 
interactive session: if my Julia session needs 5 GB RAM, a factor 3 
increase of memory will crash my computer. If my code runs for 10 seconds 
in an interactive session, 30 seconds is mildly annoying, but not a deal 
breaker. (Obviously, you can construct different examples with memory/time 
where this is different. But my point is that inconvenience changes 
discontinuously in memory usage.)

On Thursday, October 22, 2015 at 9:12:22 AM UTC+2, Christoph Ortner wrote:
>
> P.S.: It occurred to me that I should also have tried this:
>
> @time for n = 1:10; AppleAccelerate.exp(collect(s)); end
>   0.041035 seconds (60 allocations: 152.589 MB, 22.94% gc time)
>

Reply via email to