[pypy-svn] r77288 - pypy/trunk/pypy/jit/tool

fijal at codespeak.net fijal at codespeak.net
Thu Sep 23 10:40:34 CEST 2010


Author: fijal
Date: Thu Sep 23 10:40:33 2010
New Revision: 77288

Modified:
   pypy/trunk/pypy/jit/tool/traceviewer.py
Log:
Improve a bit reading of long numbers


Modified: pypy/trunk/pypy/jit/tool/traceviewer.py
==============================================================================
--- pypy/trunk/pypy/jit/tool/traceviewer.py	(original)
+++ pypy/trunk/pypy/jit/tool/traceviewer.py	Thu Sep 23 10:40:33 2010
@@ -253,9 +253,10 @@
 def main(loopfile, use_threshold, view=True):
     countname = py.path.local(loopfile + '.count')
     if countname.check():
-        counts = [re.split(r' +', line, 1) for line in countname.readlines()]
-        counts = Counts([(k.strip("\n"), int(v.strip('\n')))
-                         for v, k in counts])
+        counts = [re.split('(<code)|(<loop)', line, maxsplit=1)
+                  for line in countname.readlines()]
+        counts = Counts([('<code' + k.strip("\n"), int(v.strip('\n').strip()))
+                         for v, _, _, k in counts])
         l = list(sorted(counts.values()))
         if len(l) > 20 and use_threshold:
             counts.threshold = l[-20]



More information about the Pypy-commit mailing list