[Numpy-discussion] Matlab/Numeric/numarray benchmarks

Jason Rennie jrennie at csail.mit.edu
Thu Jan 20 10:18:40 CST 2005


On Thu, Jan 20, 2005 at 04:12:56PM +0000, Peter Chang wrote:
> 1) a missing division by count in test01()
> 2) a different default value for count in test11()

My bad.  Should have used Todd Miller's revised version.  

> 3) the Matlab code uses normally distributed random numbers whereas the
> Numeric/numarray code uses uniformlt distributed random numbers.

Good point.

Revised numbers:			+	mmult	eigen

Xeon/3.06GHz/refblas3/lapack3/numarray:	.0224	3.14	2.63
Xeon/3.06GHz/refblas3/lapack3/Numeric:	.0268	3.45	2.73
Xeon/3.06GHz/atlas3-base/numarray:	.0225	3.40	2.52
Xeon/3.06GHz/atlas3-base/Numeric:	.0268	1.04	2.57
Xeon/3.06GHz/atlas3-sse/numarray:	.0224	3.42	2.54
Xeon/3.06GHz/atlas3-sse/Numeric:	.0269	1.05	2.58
Xeon/3.06GHz/atlas3-sse2/numarray:	.0225	3.41	FP Exception
Xeon/3.06GHz/atlas3-sse2/Numeric:	.0269	FP Exc	FP Exception
Celeron/2.8GHz/atlas-base/numarray:	.0814	11.3	6.53
Celeron/2.8GHz/atlas-base/Numeric:	.0918	1.70	6.50
P4/2.8GHz/atlas-base/numarray:		.0262	4.58	2.96
P4/2.8GHz/atlas-base/Numeric:		.0318	1.15	3.00
Xeon/3.06GHz/Matlab:			.0102	.886	2.70
P4/2.8GHz/Matlab:			.0143	1.00	3.07

Very comparable (Numeric vs. numarray) except matrixmultiply, which I
guess is explained by the Debian sarge python2.3-numarray (v1.1.1) not
using the dotblas package/routine, as Todd Miller explained in an
earlier post.  I'll be looking forward to the Debian numarray release
that includes dotblas.  Looks like it will edge-out Numeric across the
board (on the Xeon) once that's in place.  For now, I'll be happy with
Numeric/atlas3-base.

The Matlab numbers use uniform random matrices.

All code attached.

Todd, Peter: sorry for the confusion I propagated.

Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: miller-benchmark.py
Type: text/x-python
Size: 2055 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20050120/097d652e/attachment-0001.py 
-------------- next part --------------
a=rand(1000,1000);
b=rand(1000,1000);
N=100;
t0 = cputime;
for i=1:N
  c = a+b;
end
t = cputime-t0;
t = t/N

N=10;
t0 = cputime;
for i=1:N
  c = a*b;
end
t = cputime-t0;
t = t/N

a=rand(500,500);
N=10;
t0 = cputime;
for i=1:N
  c = eig(a);
end
t = cputime-t0;
t = t/N



More information about the Numpy-discussion mailing list