[pypy-svn] r7421 - pypy/trunk/src/goal

hpk at codespeak.net hpk at codespeak.net
Fri Nov 19 11:57:37 CET 2004


Author: hpk
Date: Fri Nov 19 11:57:36 2004
New Revision: 7421

Modified:
   pypy/trunk/src/goal/translate_pypy.py
Log:
print a percentage summary for how many functions
contain SomeObjects in their signature 


Modified: pypy/trunk/src/goal/translate_pypy.py
==============================================================================
--- pypy/trunk/src/goal/translate_pypy.py	(original)
+++ pypy/trunk/src/goal/translate_pypy.py	Fri Nov 19 11:57:36 2004
@@ -61,6 +61,7 @@
             return binding.__class__.__name__
 
     header = True
+    num = someobjnum = 0
     for func, graph in translator.flowgraphs.items():
         unknown_input_args = len(filter(is_someobject, graph.getargs()))
         unknown_return_value = is_someobject(graph.getreturnvar())
@@ -77,6 +78,14 @@
                       'lineno': func.func_code.co_firstlineno,
                       'args': ', '.join(map(short_binding, graph.getargs())),
                       'result': short_binding(graph.getreturnvar())})
+            someobjnum += 1
+        num += 1
+    print "=" * 70
+    percent = int(num and (100.0*someobjnum / num) or 0)
+    print "somobjectness: %2d percent" % (percent)
+    print "(%d out of %d functions get or return SomeObjects" % (
+        someobjnum, num) 
+    print "=" * 70
 
 
 if __name__ == '__main__':
@@ -170,3 +179,4 @@
         debug(True)
     else:
         debug(False)
+    



More information about the Pypy-commit mailing list