[Numpy-svn] r3680 - trunk/benchmarks

numpy-svn@scip... numpy-svn@scip...
Sat Apr 7 15:19:19 CDT 2007


Author: charris
Date: 2007-04-07 15:19:17 -0500 (Sat, 07 Apr 2007)
New Revision: 3680

Modified:
   trunk/benchmarks/sorting.py
Log:
Make sorting benchmarks all sort integers

Modified: trunk/benchmarks/sorting.py
===================================================================
--- trunk/benchmarks/sorting.py	2007-04-06 21:24:54 UTC (rev 3679)
+++ trunk/benchmarks/sorting.py	2007-04-07 20:19:17 UTC (rev 3680)
@@ -5,21 +5,21 @@
 
 N = 10000
 b.title = 'Sorting %d elements' % N
-b['numarray'] = ('a=N.array(None,shape=%d);a.sort()'%N,'')
-b['numpy'] = ('a=N.empty(shape=%d);a.sort()'%N,'')
-b['Numeric'] = ('a=N.empty(shape=%d);N.sort(a)'%N,'')
+b['numarray'] = ('a=N.array(None,shape=%d,typecode="i");a.sort()'%N,'')
+b['numpy'] = ('a=N.empty(shape=%d, dtype="i");a.sort()'%N,'')
+b['Numeric'] = ('a=N.empty(shape=%d, typecode="i");N.sort(a)'%N,'')
 b.run()
 
 N1,N2 = 100,100
 b.title = 'Sorting (%d,%d) elements, last axis' % (N1,N2)
-b['numarray'] = ('a=N.array(None,shape=(%d,%d));a.sort()'%(N1,N2),'')
-b['numpy'] = ('a=N.empty(shape=(%d,%d));a.sort()'%(N1,N2),'')
-b['Numeric'] = ('a=N.empty(shape=(%d,%d));N.sort(a)'%(N1,N2),'')
+b['numarray'] = ('a=N.array(None,shape=(%d,%d),typecode="i");a.sort()'%(N1,N2),'')
+b['numpy'] = ('a=N.empty(shape=(%d,%d), dtype="i");a.sort()'%(N1,N2),'')
+b['Numeric'] = ('a=N.empty(shape=(%d,%d),typecode="i");N.sort(a)'%(N1,N2),'')
 b.run()
 
 N1,N2 = 100,100
 b.title = 'Sorting (%d,%d) elements, first axis' % (N1,N2)
-b['numarray'] = ('a=N.array(None,shape=(%d,%d));a.sort(0)'%(N1,N2),'')
-b['Numeric'] = ('a=N.empty(shape=(%d,%d));N.sort(a,0)'%(N1,N2),'')
-b['numpy'] = ('a=N.empty(shape=(%d,%d));N.sort(a,0)'%(N1,N2),'')
+b['numarray'] = ('a=N.array(None,shape=(%d,%d), typecode="i");a.sort(0)'%(N1,N2),'')
+b['numpy'] = ('a=N.empty(shape=(%d,%d),dtype="i");N.sort(a,0)'%(N1,N2),'')
+b['Numeric'] = ('a=N.empty(shape=(%d,%d),typecode="i");N.sort(a,0)'%(N1,N2),'')
 b.run()



More information about the Numpy-svn mailing list