On Monday, September 22, 2014 4:46:31 PM UTC-7, Carlos P wrote:
>
> and inlining the function seems to allocate even much more memory (almost
> 25 times more)...
> Any reason why?
>
> data = rand(10^6)
> f1(data) = [sin(i) for i in data]
>
> julia> @time f1(data);
> elapsed time: 0.023104734 secon
and inlining the function seems to allocate even much more memory (almost
25 times more)...
Any reason why?
data = rand(10^6)
f1(data) = [sin(i) for i in data]
julia> @time f1(data);
elapsed time: 0.023104734 seconds (8000128 bytes allocated)
julia> @time [sin(i) for i in data];
elapsed time: 1
On Thursday, September 18, 2014 2:31:14 PM UTC-5, Johan Sigfrids wrote:
>
> So I was looking at allocations in some code and I noticed I sped things
> up significantly by changing map to a list comprehension. Doing some
> microbenchmarking I noticed that map allocates far more memory than a list