Author: Edd Barrett <vex...@gmail.com>
Branch: min_5_secs
Changeset: r302:e8a9a5a3a102
Date: 2014-12-15 15:38 +0000
http://bitbucket.org/pypy/benchmarks/changeset/e8a9a5a3a102/

Log:    Reset the TaskWorkArea without allocating a new instance.

        From Stefan Marr. Thanks.

diff --git a/unladen_swallow/performance/richards.py 
b/unladen_swallow/performance/richards.py
--- a/unladen_swallow/performance/richards.py
+++ b/unladen_swallow/performance/richards.py
@@ -144,6 +144,9 @@
 
 class TaskWorkArea(object):
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.taskTab = [None] * TASKTABSIZE
 
         self.taskList = None
@@ -363,8 +366,7 @@
 
     def run(self, iterations):
         for i in xrange(iterations):
-            taskWorkArea.holdCount = 0
-            taskWorkArea.qpktCount = 0
+            taskWorkArea.reset()
 
             IdleTask(I_IDLE, 1, 10000, TaskState().running(), IdleTaskRec())
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to