function timepermute(N::Int,Dmax::Int,p=randperm(N))
dims=ntuple(n->rand(1:Dmax),N);
A=randn(dims);
B1=randn(dims[p]);
t1=@elapsed for i=1:10;Base.permutedimsold!(B1,A,p);end
B2=randn(dims[p]);
t2=@elapsed for i=1:10;Base.permutedims!(B2,A,p);end
return length(A),t1,t2
end
timepermute (generic function with 2 methods)
for N=2:8;timepermute(N,3);end
T1=zeros(Float64,700)
T2=zeros(Float64,700)
X=zeros(Int64,700)
for i=1:100
Dmax=ifloor(10.^(8./2))
gc()
x,t1,t2=timepermute(2,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=100+(1:100)
Dmax=ifloor(10.^(8./3))
gc()
x,t1,t2=timepermute(3,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=200+(1:100)
Dmax=ifloor(10.^(8./4))
gc()
x,t1,t2=timepermute(4,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=300+(1:100)
Dmax=ifloor(10.^(8./5))
gc()
x,t1,t2=timepermute(5,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=400+(1:100)
Dmax=ifloor(10.^(8./6))
gc()
x,t1,t2=timepermute(6,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=500+(1:100)
Dmax=ifloor(10.^(8./7))
gc()
x,t1,t2=timepermute(7,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
for i=600+(1:100)
Dmax=ifloor(10.^(8./8))
gc()
x,t1,t2=timepermute(8,Dmax)
T1[i]=t1
T2[i]=t2
X[i]=x
end
using PyPlot
INFO: Loading help data...
loglog(X,T1,"ob",X,T2,"og")
2-element Array{Any,1}: PyObject <matplotlib.lines.Line2D object at 0x1107e5290> PyObject <matplotlib.lines.Line2D object at 0x110802950>
loglog(T1,T2,"ob",T1,2*T1,"r",T1,T1,"g")
3-element Array{Any,1}: PyObject <matplotlib.lines.Line2D object at 0x104f134d0> PyObject <matplotlib.lines.Line2D object at 0x1103d44d0> PyObject <matplotlib.lines.Line2D object at 0x1103d4b90>