[pypy-svn] r58976 - in pypy/build/benchmem: . benchmark

hpk at codespeak.net hpk at codespeak.net
Sat Oct 11 15:44:17 CEST 2008


Author: hpk
Date: Sat Oct 11 15:44:17 2008
New Revision: 58976

Modified:
   pypy/build/benchmem/benchmark/sizes.py
   pypy/build/benchmem/report.py
Log:
(xoraxax,hpk) dont depend on socket module, add benchmarks

Modified: pypy/build/benchmem/benchmark/sizes.py
==============================================================================
--- pypy/build/benchmem/benchmark/sizes.py	(original)
+++ pypy/build/benchmem/benchmark/sizes.py	Sat Oct 11 15:44:17 2008
@@ -115,6 +115,20 @@
     l = [{i:None} for i in range(iter1)]
     checkpoint(collect=True)
 
+def bench_list_of_dict_oldinstance_withintattr(iter1):
+    class A:
+	def __init__(self, i):
+		self.i = i
+    l = [{A(i):None} for i in range(iter1)]
+    checkpoint(collect=True)
+
+def bench_list_of_dict_newinstance_withintattr(iter1):
+    class A(object):
+	def __init__(self, i):
+		self.i = i
+    l = [{A(i):None} for i in range(iter1)]
+    checkpoint(collect=True)
+
 def bench_list_of_dict_strkey_len1(iter1):
     l = [{'%07d'%i:None} for i in range(iter1)]
     checkpoint(collect=True)
@@ -360,6 +374,8 @@
 
 # ____________________________________________________________
 
+import sys,new
+sys.modules['socket'] = new.module("socket")
 from email.Message import Message
 
 def bench_list_of_messages(iter1):

Modified: pypy/build/benchmem/report.py
==============================================================================
--- pypy/build/benchmem/report.py	(original)
+++ pypy/build/benchmem/report.py	Sat Oct 11 15:44:17 2008
@@ -140,9 +140,9 @@
             for result in results:
                 incsize = self.get_incremental_size(result)
                 # colors work but messup table layout
-                #color = incsize <= basesize and "green" or "red"
-                #row.append(tw.markup(str(incsize), **{color:True}))
-                row.append(incsize)
+                color = incsize <= basesize and "green" or "red"
+                row.append(tw.markup(str(incsize), **{color:True}))
+                #row.append(incsize)
             rows.append(row)
         tw.line(asciitable(rows))
  



More information about the Pypy-commit mailing list