[pypy-commit] extradoc extradoc: benchmark results
hakanardo
noreply at buildbot.pypy.org
Thu Sep 1 13:36:50 CEST 2011
Author: Hakan Ardo <hakan at debian.org>
Branch: extradoc
Changeset: r3893:0fabc59e39ad
Date: 2011-09-01 13:36 +0200
http://bitbucket.org/pypy/extradoc/changeset/0fabc59e39ad/
Log: benchmark results
diff --git a/talk/iwtc11/benchmarks/image/numpy_compare.py b/talk/iwtc11/benchmarks/image/numpy_compare.py
--- a/talk/iwtc11/benchmarks/image/numpy_compare.py
+++ b/talk/iwtc11/benchmarks/image/numpy_compare.py
@@ -146,7 +146,7 @@
return numpy.minimum(numpy.sqrt(dx*dx + dy*dy) / 4.0, 255).astype('B')
@wrap_numpy
-def sobel_magnitude_numpy2(a): # 89 fps
+def sobel_magnitude_numpy2(a): # 89 fps (Image), 81 fps (NNImage), 80 fps (BilinImage)
dx = -1.0 * a[0:-3, 0:-3] + 1.0 * a[0:-3, 2:-1] + \
-2.0 * a[1:-2, 0:-3] + 2.0 * a[1:-2, 2:-1] + \
-1.0 * a[2:-1, 0:-3] + 1.0 * a[2:-1, 2:-1]
@@ -157,7 +157,7 @@
return res.astype('B')
@wrap_numpy
-def sobel_magnitude_numpy3(a):
+def sobel_magnitude_numpy3(a): # 106 fps
dx = numpy.zeros(a.shape)
scipy.ndimage.filters.sobel(a, 1, dx)
dy = numpy.zeros(a.shape)
@@ -165,7 +165,7 @@
return numpy.minimum(numpy.sqrt(dx*dx + dy*dy) / 4.0, 255).astype('B')
@wrap_numpy
-def sobel_magnitude_numpy4(a):
+def sobel_magnitude_numpy4(a): # 105 fps
dx = numpy.zeros(a.shape)
scipy.ndimage.filters.convolve(a, numpy.array([[-1.0, 0.0, 1.0],
[-2.0, 0.0, 2.0],
@@ -295,12 +295,12 @@
start = start0 = time()
for fcnt, img in enumerate(mplayer(BilinImage, 'test.avi', '-benchmark')):
#view(img)
- view(sobel_magnitude(img))
- #view(sobel_magnitude_numpy(img))
+ #view(sobel_magnitude(img))
+ #view(sobel_magnitude_numpy2(img))
#view(magnify(img))
- #view(magnify_numpy(img))
+ view(magnify_numpy(img))
#view(local_max(img))
- view(local_edge(sobel_magnitude(img)))
+ #view(local_edge(sobel_magnitude(img)))
print 1.0 / (time() - start), 'fps, ', (fcnt-2) / (time() - start0), 'average fps'
start = time()
if fcnt==2:
More information about the pypy-commit
mailing list