Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: extradoc
Changeset: r3784:08c432056868
Date: 2011-06-24 10:04 +0200
http://bitbucket.org/pypy/extradoc/changeset/08c432056868/

Log:    update benchmarks

diff --git a/talk/iwtc11/benchmarks/benchmark.sh 
b/talk/iwtc11/benchmarks/benchmark.sh
--- a/talk/iwtc11/benchmarks/benchmark.sh
+++ b/talk/iwtc11/benchmarks/benchmark.sh
@@ -24,19 +24,19 @@
     if [ "$1" == "python2.6" ]; then
         EXTRA_OPTS='-w 1 -n 1'
     fi
-    $* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main int
-    $* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main float
-    $* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main Fix16
+    #$* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main int
+    #$* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main float
+    #$* ./runner.py $EXTRA_OPTS sqrt/sqrt.py main Fix16
     #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3 1
     #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv5 1
-    $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3 100
-    $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv5 100
-    $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3 1000
-    $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv5 1000
+    #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3 100
+    #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv5 100
+    #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3 1000
+    #$* ./runner.py $EXTRA_OPTS convolution/convolution.py conv5 1000
     $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3x3 1000000 3
     $* ./runner.py $EXTRA_OPTS convolution/convolution.py conv3x3 1000 1000
     $* ./runner.py $EXTRA_OPTS convolution/convolution.py dilate3x3 1000 1000
-    $* ./runner.py $EXTRA_OPTS convolution/convolution.py sobel_magnitude 1000 
1000
+    #$* ./runner.py $EXTRA_OPTS convolution/convolution.py sobel_magnitude 
1000 1000
     #$* ./runner.py $EXTRA_OPTS image/noborder.py main NoBorderImagePadded
     #$* ./runner.py $EXTRA_OPTS image/noborder.py main NoBorderImagePadded iter
     #$* ./runner.py $EXTRA_OPTS image/noborder.py main NoBorderImagePadded 
range
diff --git a/talk/iwtc11/benchmarks/convolution/convolution.py 
b/talk/iwtc11/benchmarks/convolution/convolution.py
--- a/talk/iwtc11/benchmarks/convolution/convolution.py
+++ b/talk/iwtc11/benchmarks/convolution/convolution.py
@@ -57,9 +57,8 @@
                 self[x, y] = data[y][x]
         return self
 
-def _conv3x3(a, k):
+def _conv3x3(a, b, k):
     assert k.width == k.height == 3
-    b = Array2D(a.width, a.height)
     for y in xrange(1, a.height-1):
         for x in xrange(1, a.width-1):
             b[x, y] = k[2,2]*a[x-1, y-1] + k[1,2]*a[x, y-1] + k[0,2]*a[x+1, 
y-1] + \
@@ -67,9 +66,8 @@
                       k[2,0]*a[x-1, y+1] + k[1,0]*a[x, y+1] + k[0,0]*a[x+1, 
y+1]
     return b
 
-def morphology3x3(a, k, func):
+def morphology3x3(a, b, k, func):
     assert k.width == k.height == 3
-    b = Array2D(a.width, a.height)
     for y in xrange(1, a.height-1):
         for x in xrange(1, a.width-1):
             b[x, y] = func(k[2,2]*a[x-1, y-1], k[1,2]*a[x, y-1], k[0,2]*a[x+1, 
y-1], \
@@ -77,20 +75,24 @@
                            k[2,0]*a[x-1, y+1], k[1,0]*a[x, y+1], k[0,0]*a[x+1, 
y+1])
     return b
 
-def _dilate3x3(a, k):
-    return morphology3x3(a, k, max)
+def _dilate3x3(a, b, k):
+    return morphology3x3(a, b, k, max)
 
 def _erode3x3(a, k):
     return morphology3x3(a, k, min)
 
 def conv3x3(args):
+    a = Array2D(int(args[0]), int(args[1]))
+    b = Array2D(a.width, a.height)
     for i in range(10):
-        _conv3x3(Array2D(int(args[0]), int(args[1])), Array2D(3,3))
+        _conv3x3(a, b, Array2D(3,3))
     return 'conv3x3(Array2D(%sx%s))' % tuple(args)
 
 def dilate3x3(args):
+    a = Array2D(int(args[0]), int(args[1]))
+    b = Array2D(a.width, a.height)
     for i in range(10):
-        _dilate3x3(Array2D(int(args[0]), int(args[1])), Array2D(3,3))
+        _dilate3x3(a, b, Array2D(3,3))
     return 'dilate3x3(Array2D(%sx%s))' % tuple(args)
 
 def _sobel_magnitude(a):
diff --git a/talk/iwtc11/benchmarks/runall.sh b/talk/iwtc11/benchmarks/runall.sh
--- a/talk/iwtc11/benchmarks/runall.sh
+++ b/talk/iwtc11/benchmarks/runall.sh
@@ -4,7 +4,7 @@
 #./benchmark.sh pypy --jit enable_opts=intbounds:rewrite:virtualize:heap:unroll
 ./benchmark.sh pypy --jit enable_opts=intbounds:rewrite:virtualize:heap
 #./benchmark.sh gcc
-./benchmark.sh gcc -O2
+#./benchmark.sh gcc -O2
 ./benchmark.sh gcc -O3 -march=native -fno-tree-vectorize
 ./benchmark.sh python2.7
 ./benchmark.sh python2.6 psyco-wrapper.py
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to