[Numpy-discussion] Matlab/Numeric/numarray benchmarks

Jason Rennie jrennie at csail.mit.edu
Thu Jan 20 07:45:45 CST 2005


On Thu, Jan 20, 2005 at 10:33:48AM -0500, Perry Greenfield wrote:
> Could you at least give enough information to understand the what the
> benchmark is? (Size of arrays, what the 3 columns are, etc). What is
> the benchmark code? I see references to benchmark.py but there doesn't
> appear to be any attachment.

It's Simon Burton's benchmark.py and bench.m code.  Only modification
I made was to move the imports to the top.  Matlab code is identical.
See attached for the exact code.

Jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: benchmark.py
Type: text/x-python
Size: 1552 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/numpy-discussion/attachments/20050120/ba2cf2a2/attachment.py 
-------------- next part --------------
a=randn(1000,1000);
b=randn(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=randn(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