From 738149c9bfb9965d013d01ef99f9bb1c2819e7e8 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Tue, 15 Jun 2010 14:28:22 +0000 Subject: Imported Upstream version 2.0.0 --- bin/memoicmp.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'bin/memoicmp.py') 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) -- cgit v1.2.3