Changeset 1794 for proto/SymbolTable


Ignore:
Timestamp:
Dec 18, 2011, 9:45:34 AM (8 years ago)
Author:
vla24
Message:

updated wcd performance script

Location:
proto/SymbolTable/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/src/perf_script_wcd.py

    r1793 r1794  
    55
    66testfile_home = "../test/test_files/"
    7 programs = ['wcd']
     7#programs = ['wcd']
    88#TODO: Change the testfiles
    99dictionaryfiles = ['wcd_the_mansion.txt', 'wcd_alice_in_wonderland.txt', 'wcd_pride_and_prejudice.txt']
    1010testfiles = ['wcd_the_republic_by_plato.txt', 'wcd_tale_of_two_cities.txt', 'wcd_a_sailor_of_king_george.txt', 'wcd_metamorphosis.txt', 'wcd_bio_papers.txt']
     11repeat = 10
    1112
    1213def run_test():     
    1314  mes_f = open('mesfile', 'w')
    14   for program in programs:
    15     for index in range(len(testfiles)):
    16       dictionary_path = testfile_home+dictionaryfiles[index]
    17       text_path = testfile_home+testfiles[index]
     15  for dictionary in dictionaryfiles:
     16    dictionary_path = testfile_home+dictionary
     17    # convert files to lowercase
     18    dictionary_new_path = run_wcd.convert_file_to_lowercase(dictionary_path)
     19
     20    for text in testfiles:
     21      text_path = testfile_home+text
    1822      # convert files to lowercase
    19       dictionary_new_path = run_wcd.convert_file_to_lowercase(dictionary_path)
    2023      text_new_path = run_wcd.convert_file_to_lowercase(text_path)
    21       for i in range(10):
    22         call(['./wcd', dictionary_new_path, text_new_path], stderr=mes_f)
    23       run_wcd.delete_temporary_files(dictionary_new_path, text_new_path)
     24
     25      for i in range(repeat):
     26        call(['./wcd', dictionary_new_path, text_new_path], stderr=mes_f)
     27      run_wcd.delete_temporary_file(text_new_path)
     28
     29    run_wcd.delete_temporary_file(dictionary_new_path)
    2430
    2531def analyze_rslt():     
     
    3541      first_row =  first_row[:-4]
    3642      print first_row
    37       for program in programs:
    38         row = program + '   \t&\t'
     43      for dictionary in dictionaryfiles:
     44        row = dictionary + '   \t&\t'
    3945        for testfile in testfiles:
    40           result = results_int[0:10]
    41           results_int = results_int[10:]
     46          result = results_int[0:repeat]
     47          results_int = results_int[repeat:]
    4248          row +=  str(min(result)/1000.0) + '   &\t'
    4349        row = row[:-4]
  • proto/SymbolTable/src/run_wcd.py

    r1722 r1794  
    4343    os.remove (textfile)
    4444
     45def delete_temporary_file(f):
     46    os.remove (f)
     47
    4548def main():
    4649    if (len(sys.argv)  < 3):
Note: See TracChangeset for help on using the changeset viewer.