diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2007-04-07 20:19:17 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2007-04-07 20:19:17 +0000 |
commit | a083ce52b673c6dcadd800d64bb098d89f1e8e12 (patch) | |
tree | 8582c5758ec101b8aad072c7f3abd5e89ad955b7 /benchmarks | |
parent | ada65fd59c08e0a052c0ad217c11cae0e2bd7edd (diff) | |
download | numpy-a083ce52b673c6dcadd800d64bb098d89f1e8e12.tar.gz |
Make sorting benchmarks all sort integers
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/sorting.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/benchmarks/sorting.py b/benchmarks/sorting.py index 8f88896e8..0148508cc 100644 --- a/benchmarks/sorting.py +++ b/benchmarks/sorting.py @@ -5,21 +5,21 @@ b = Benchmark(modules,runs=3,reps=100) 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() |