Changeset 3409


Ignore:
Timestamp:
Jul 20, 2013, 4:08:42 PM (6 years ago)
Author:
cameron
Message:

Add overrides to automatically switch REs for nrgrep and agrep

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/RE/performance/perf.py

    r3408 r3409  
    7474        if execution.program=='nrgrep112':
    7575                nrgreplocation='nrgrep-1.1.2/nrgrep'
    76                 cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+nrgreplocation+' -c \'' + execution.expression.expression + '\' '+ execution.file.file + redirectoutput]
     76                e = execution.expression.expression
     77                if nrgrep_override.has_key(e): e = nrgrep_override[e]
     78                cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+nrgreplocation+' -c \'' + e + '\' '+ execution.file.file + redirectoutput]
    7779                p = Popen(cmd,shell=True)
    7880                p.wait()
    7981        if execution.program=='nrgrep':
    8082                nrgreplocation='nrgrep-1.0/nrgrep'
    81                 cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+nrgreplocation+' -c \'' + execution.expression.expression + '\' '+ execution.file.file + redirectoutput]
     83                e = execution.expression.expression
     84                if nrgrep_override.has_key(e): e = nrgrep_override[e]
     85                cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+nrgreplocation+' -c \'' + e + '\' '+ execution.file.file + redirectoutput]
    8286                p = Popen(cmd,shell=True)
    8387                p.wait()
     
    8993        if execution.program=='agrep':
    9094                agreplocation='agrep-3.41/agrep'
    91                 cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+agreplocation+' -c \'' + execution.expression.expression + '\' '+ execution.file.file + redirectoutput]
     95                e = execution.expression.expression
     96                if agrep_override.has_key(e): e = agrep_override[e]
     97                cmd = ['perf stat -x, -o perfoutput -r '+str(count)+' -e '+ execution.stat+ ' '+agreplocation+' -0 -c \'' + e + '\' '+ execution.file.file + redirectoutput]
    9298                p = Popen(cmd,shell=True)
    9399                p.wait()
     
    115121
    116122#http://sljit.sourceforge.net/regex_perf.html
    117 files.append(File('data/mark.txt','mark_twain',('regex_perf2',)))
     123files.append(File('data/mark.txt','mark_twain',('regex_perf',)))
    118124expressions.append(Expression('Twain', 'Twain', ('regex_perf',)))
    119125expressions.append(Expression('^Twain', '^Twain', ('regex_perf',)))
     
    133139expressions.append(Expression('Tom.{10,25}river|river.{10,25}Tom', 'Tom_near_river', ('regex_perf',)))
    134140
     141
    135142expressions.append(Expression('a[^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x]b', 'a----b', ('regex_perf2',)))
    136143expressions.append(Expression('.?.?.?(Tom|Sawyer|Huckleberry|Finn)', '__Tom_or_Huck', ('regex_perf2',)))
     
    142149expressions.append(Expression('Tom...........?.?.?.?.?.?.?.?.?.?.?.?.?.?.?river|river...........?.?.?.?.?.?.?.?.?.?.?.?.?.?.?Tom', 'Tom_near_river', ('regex_perf2',)))
    143150
    144 
    145 
     151nrgrep_override = {}
     152nrgrep_override['a[^x]{20}b'] = 'a[^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x][^x]b'
     153nrgrep_override['.{0,3}(Tom|Sawyer|Huckleberry|Finn)'] = '.?.?.?(Tom|Sawyer|Huckleberry|Finn)'
     154nrgrep_override['^[a-zA-Z]{0,4}ing[^a-zA-Z]'] = '^[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?[a-zA-Z]?ing[^a-zA-Z]'
     155nrgrep_override['^[a-zA-Z ]{5,}$'] = '^[a-zA-Z ][a-zA-Z ][a-zA-Z ][a-zA-Z ][a-zA-Z ][a-zA-Z ]*[\x0d]$'
     156nrgrep_override['^.{16,20}$'] = '^................?.?.?.?[\x0d]$'
     157nrgrep_override['([a-f](.[d-m].){0,2}[h-n]){2}'] = '[a-f](.[d-m].)?(.[d-m].)?[h-n][a-f](.[d-m].)?(.[d-m].)?[h-n]'
     158nrgrep_override['"[^"]{0,30}[?!.]"'] = '"[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[^"]?[?!.]"'
     159nrgrep_override['Tom.{10,25}river|river.{10,25}Tom'] = 'Tom...........?.?.?.?.?.?.?.?.?.?.?.?.?.?.?river|river...........?.?.?.?.?.?.?.?.?.?.?.?.?.?.?Tom'
     160
     161agrep_override = nrgrep_override
     162agrep_override['Huck[a-zA-Z]+|Finn[a-zA-Z]+'] = 'Huck[a-zA-Z][a-zA-Z]*|Finn[a-zA-Z][a-zA-Z]*'
     163agrep_override['[a-zA-Z]+ing'] = '[a-zA-Z][a-zA-Z]*ing'
     164agrep_override['[a-zA-Z]+ing$'] = '[a-zA-Z][a-zA-Z]*ing$'
     165agrep_override['([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?'] = '([a-zA-Z][a-zA-Z0-9]*)://([^ /][^ /]*)(/[^ ]*)?'
     166agrep_override['([^ @]+)@([^ @]+)'] = '([^ @][^ @]*)@([^ @][^ @]*)'
     167agrep_override['([a-zA-Z][a-zA-Z0-9]*)://([^ /]+)(/[^ ]*)?|([^ @]+)@([^ @]+)'] = '([a-zA-Z][a-zA-Z0-9]*)://([^ /][^ /]*)(/[^ ]*)?|([^ @][^ @]*)@([^ @][^ @]*)'
    146168
    147169
     
    154176
    155177
    156 #programs = ['bitstreams','grep', 'nrgrep', 'nrgrep112', 'pcregrep']#,'agrep']
    157 programs = ['bitstreams','nrgrep112']#,'agrep']
    158 stats = ['cycles', 'instructions']
     178programs = ['bitstreams','agrep', 'nrgrep112', 'grep', 'pcregrep']
     179stats = ['cycles:u', 'instructions:u', 'cache-misses:u', 'L1-dcache-load-misses:u', 'L1-dcache-store-misses:u', 'L1-dcache-prefetch-misses:u', 'L1-icache-load-misses:u']
    159180
    160181typeargument=False
Note: See TracChangeset for help on using the changeset viewer.