Forget about `a[1]::Int += 1`
The larger amount of allocated memory is solved by `a = zeros(Int,
dims...)::Vector{Int}`
`@time test1(a)` still allocates a little more memory just because it is
the first run of the `@time` macro.
((( In a freshly opened session:
> @time ()
elapsed time: 3.938e-6 seconds (6660 bytes allocated)
> @time ()
elapsed time: 6.84e-7 seconds (48 bytes allocated)
)))
On Sunday, January 5, 2014 12:41:22 AM UTC, Cristóvão Duarte Sousa wrote:
>
> a[1]::Int += 1
> in test1 makes it to allocate the same amount of memory as test2.
>
>