[Python-checkins] benchmarks: Minor code clean-up.
brett.cannon
python-checkins at python.org
Sat Sep 15 00:12:32 CEST 2012
http://hg.python.org/benchmarks/rev/8dda41adf5fd
changeset: 178:8dda41adf5fd
user: Brett Cannon <brett at python.org>
date: Fri Sep 14 13:49:22 2012 -0400
summary:
Minor code clean-up.
files:
performance/bm_fannkuch.py | 2 +-
performance/bm_meteor_contest.py | 4 ----
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/performance/bm_fannkuch.py b/performance/bm_fannkuch.py
--- a/performance/bm_fannkuch.py
+++ b/performance/bm_fannkuch.py
@@ -56,7 +56,7 @@
def main(n):
times = []
- for i in range(n):
+ for i in xrange(n):
t0 = time.time()
fannkuch(DEFAULT_ARG)
tk = time.time()
diff --git a/performance/bm_meteor_contest.py b/performance/bm_meteor_contest.py
--- a/performance/bm_meteor_contest.py
+++ b/performance/bm_meteor_contest.py
@@ -27,7 +27,6 @@
def permute(ido, r_ido, rotate=rotate, flip=flip):
-
ps = [ido]
for r in xrange(dir_no - 1):
ps.append(rotate(ps[-1]))
@@ -47,7 +46,6 @@
def get_footprints(board, cti, pieces):
-
fps = [[[] for p in xrange(len(pieces))] for ci in xrange(len(board))]
for c in board:
for pi, p in enumerate(pieces):
@@ -68,7 +66,6 @@
def get_puzzle(w=w, h=h):
-
board = [E*x + S*y + (y%2) for y in xrange(h) for x in xrange(w)]
cti = dict((board[i], i) for i in xrange(len(board)))
@@ -89,7 +86,6 @@
def print_board(board, w=w, h=h):
-
for y in xrange(h):
for x in xrange(w):
print(board[x + y * w])
--
Repository URL: http://hg.python.org/benchmarks
More information about the Python-checkins
mailing list