I don't think so.. It happens on repeat function runs. I also updated to
use benchmarktools.jl
Even though, it takes so long (> 10 mins) on 0.5.0 I've only been patient
enough for it to complete once...
using BenchmarkTools
function testf(x)
r = squeeze(mean(x[:,:,1:80,:,:,56:800],(1,2,3,4,5)),(1,2,3,4,5));
end
x = rand(10,10,100,4,4,1000) #Dummy array
@benchmark testf(x)
In 0.5.0 I get the following (with huge memory usage):
BenchmarkTools.Trial:
samples: 1
evals/sample: 1
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 23.36 gb
allocs estimate: 1043200022
minimum time: 177.94 s (1.34% GC)
median time: 177.94 s (1.34% GC)
mean time: 177.94 s (1.34% GC)
maximum time: 177.94 s (1.34% GC)
In 0.4.7 I get:
BenchmarkTools.Trial:
samples: 11
evals/sample: 1
time tolerance: 5.00%
memory tolerance: 1.00%
memory estimate: 727.55 mb
allocs estimate: 79
minimum time: 425.82 ms (0.06% GC)
median time: 485.95 ms (11.31% GC)
mean time: 482.67 ms (10.37% GC)
maximum time: 503.27 ms (11.22% GC)
On Monday, 31 October 2016 19:07:28 UTC-4, Yichao Yu wrote:
>
> On Mon, Oct 31, 2016 at 6:34 PM, Ian Butterworth
> <[email protected] <javascript:>> wrote:
> > I'm not sure of the etiquette, but I'm cross-posting this from
> stackoverflow
> > as it seems like quite a significant issue...
> >
> > As an example:
> >
> > x = rand(10,10,100,4,4,1000) #Dummy array
> >
> > tic()
> > r = squeeze(mean(x[:,:,1:80,:,:,56:800],(1,2,3,4,5)),(1,2,3,4,5))
> > toc()
> >
> > Julia 0.5.0 -> elapsed time: 176.357068283 seconds
> >
> > Julia 0.4.7 -> elapsed time: 1.19991952 seconds
> >
> >
> >
> > I know this isn't really good practice, and I'm looking into using
> `view`
> > but it's quite a bit performance decrease, so I thought I'd raise it.
> >
>
> AFAICT it's all compilation time.
>
> >
> >
> http://stackoverflow.com/questions/40351485/why-is-indexing-a-large-matrix-170x-slower-slower-in-julia-0-5-0-than-0-4-7
>
>