summaryrefslogtreecommitdiff
path: root/bin/memoicmp.py
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
committerLuca Falavigna <dktrkranz@debian.org>2010-06-15 14:28:28 +0000
commit0ed55e71a9f4b9cda836c6a4a5408cece60db0c6 (patch)
treeb1e82f6e428ac15ed9b4de93e48d8079420d537d /bin/memoicmp.py
parentfe00e4f75ba00298c30d6854b245c2a42c6542b8 (diff)
parent738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (diff)
Merge commit 'upstream/2.0.0'
Diffstat (limited to 'bin/memoicmp.py')
-rw-r--r--bin/memoicmp.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/bin/memoicmp.py b/bin/memoicmp.py
index f45ecb0..812af66 100644
--- a/bin/memoicmp.py
+++ b/bin/memoicmp.py
@@ -1,21 +1,24 @@
#!/usr/bin/env python
#
-# A script to compare the --debug=memoizer output found int
+# A script to compare the --debug=memoizer output found in
# two different files.
-import sys,string
+import sys
def memoize_output(fname):
- mout = {}
- lines=filter(lambda words:
- len(words) == 5 and
- words[1] == 'hits' and words[3] == 'misses',
- map(string.split, open(fname,'r').readlines()))
- for line in lines:
- mout[line[-1]] = ( int(line[0]), int(line[2]) )
- return mout
+ mout = {}
+ #lines=filter(lambda words:
+ # len(words) == 5 and
+ # words[1] == 'hits' and words[3] == 'misses',
+ # map(string.split, open(fname,'r').readlines()))
+ #for line in lines:
+ # mout[line[-1]] = ( int(line[0]), int(line[2]) )
+ for line in open(fname,'r').readlines():
+ words = line.split()
+ if len(words) == 5 and words[1] == 'hits' and words[3] == 'misses':
+ mout[words[-1]] = ( int(words[0]), int(words[2]) )
+ return mout
-
def memoize_cmp(filea, fileb):
ma = memoize_output(filea)
mb = memoize_output(fileb)