[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: 3D versus 2D Indexing and the Speed Thereof
From: |
Luis Ortiz |
Subject: |
RE: 3D versus 2D Indexing and the Speed Thereof |
Date: |
Tue, 21 Nov 2006 04:12:34 -0500 |
JWE:
Just out of curiousity, what system/compiler were you using?
I was on an EM64T Opteron 8xx using GCC 3.3.5 . I suspect it
of being worse than usual because of the horrid inlining behaviour that
GCC had back then.
LFO
-----Original Message-----
From: John W. Eaton [mailto:address@hidden
Sent: Tue 11/21/2006 3:16 AM
To: Luis Ortiz
Cc: address@hidden
Subject: 3D versus 2D Indexing and the Speed Thereof
BTW, on my system, I see the following results. Not great, but not a
factor of 22 either.
octave:4> for i = 1:3
> x = zeros (n, 50, 100);
> t = cputime ();
> for i = 1:100
> z = x(:,:,i);
> end
> t1 = cputime () - t;
> x = zeros (50*n, 100);
> t = cputime ();
> for i = 1:100
> z = x(:,i);
> end
> t2 = cputime () - t;
> fprintf ("%6d %f %f %f\n", n, t1, t2, t1/t2);
> n = n * 10;
> end
10 0.068005 0.012000 5.667083
100 0.604037 0.100006 6.040008
1000 5.996376 1.036065 5.787645
OTOH, if Octave's Array class knew how to do slices and if we
recognized these operations as slices, then the time should be
constant here, not proportional to the number of elements copied.
jwe