diff options
author | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:22 +0000 |
---|---|---|
committer | Luca Falavigna <dktrkranz@debian.org> | 2010-06-15 14:28:22 +0000 |
commit | 738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (patch) | |
tree | 0397d9bf3b12c903dc73419585df231397ff343c /bin/memoicmp.py | |
parent | e7885e3af440eaef38a9301fd92a105afc8ddebb (diff) |
Imported Upstream version 2.0.0upstream/2.0.0
Diffstat (limited to 'bin/memoicmp.py')
-rw-r--r-- | bin/memoicmp.py | 25 |
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) |