Ignore:
Timestamp:
Aug 19, 2021, 1:58:46 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, pthread-emulation, qualifiedEnum
Children:
262deda0
Parents:
8a1d95af
Message:

update exception benchmarks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/andrew_beach_MMath/code/test.sh

    r8a1d95af rf79ee0d  
    44# test.sh LANGUAGE TEST
    55#   Run the TEST in LANGUAGE.
     6# test.sh -a
     7#   Build all tests.
    68# test.sh -b SOURCE_FILE...
    79#   Build a test from SOURCE_FILE(s).
     10# test.sh -c
     11#   Clean all executables.
    812# test.sh -v LANGUAGE TEST FILE
    913#   View the result from TEST in LANGUAGE stored in FILE.
    1014
    11 readonly ITERATIONS=1000000 # 1 000 000, one million
     15readonly ITERS_1M=1000000 # 1 000 000, one million
     16readonly ITERS_10M=10000000 # 10 000 000, ten million
     17readonly ITERS_100M=100000000 # 100 000 000, hundred million
     18readonly ITERS_1000M=1000000000 # 1 000 000 000, billion
    1219readonly STACK_HEIGHT=100
    1320
     
    2431        *.cfa)
    2532                # Requires a symbolic link.
    26                 mmake "${1%.cfa}" "$1" ./cfa -DNDEBUG -nodebug -O3 "$1" -o "${1%.cfa}"
     33                mmake "${1%.cfa}" "$1" cfa -DNDEBUG -nodebug -O3 "$1" -o "${1%.cfa}"
    2734                ;;
    2835        *.cpp)
    29                 mmake "${1%.cpp}-cpp" "$1" g++ -DNDEBUG -O3 "$1" -o "${1%.cpp}-cpp"
     36                mmake "${1%.cpp}-cpp" "$1" g++-10 -DNDEBUG -O3 "$1" -o "${1%.cpp}-cpp"
    3037                ;;
    3138        *.java)
     
    3946)
    4047
    41 if [ "-b" = "$1" ]; then
     48if [ "-a" = "$1" ]; then                        # build all
     49        for file in *.cfa *.cpp *.java; do
     50                build $file
     51        done
     52        exit 0
     53elif [ "-b" = "$1" ]; then                      # build given
    4254        for file in "${@:2}"; do
    4355                build $file
    4456        done
    4557        exit 0
     58elif [ "-c" = "$1" ]; then                      # clean all
     59        rm -f `basename -s ".cfa" -a *.cfa`
     60        rm -f `basename -s ".cpp" -a *.cpp`
     61        rm -f *-cpp
     62        rm -f *.class
     63        exit 0
    4664elif [ "-v" = "$1" -a 4 = "$#" ]; then
    47     TEST_LANG="$2"
    48     TEST_CASE="$3"
    49     VIEW_FILE="$4"
     65        TEST_LANG="$2"
     66        TEST_CASE="$3"
     67        VIEW_FILE="$4"
    5068elif [ 2 -eq "$#" ]; then
    5169        TEST_LANG="$1"
     
    6381
    6482case "$TEST_CASE" in
    65 cond-match-all)
    66         CFAT="./cond-catch $ITERATIONS 1"
    67         CFAR="./cond-fixup $ITERATIONS 1"
    68         CPP="./cond-catch-cpp $ITERATIONS 1"
    69         JAVA="java CondCatch $ITERATIONS 1"
    70         PYTHON="./cond_catch.py $ITERATIONS 1"
    71         ;;
    72 cond-match-none)
    73         CFAT="./cond-catch $ITERATIONS 0"
    74         CFAR="./cond-fixup $ITERATIONS 0"
    75         CPP="./cond-catch-cpp $ITERATIONS 0"
    76         JAVA="java CondCatch $ITERATIONS 0"
    77         PYTHON="./cond_catch.py $ITERATIONS 0"
    78         ;;
    79 cross-catch)
    80         CFAT="./cross-catch $ITERATIONS"
    81         CFAR="./cross-resume $ITERATIONS"
    82         CPP="./cross-catch-cpp $ITERATIONS"
    83         JAVA="java CrossCatch $ITERATIONS"
    84         PYTHON="./cross_catch.py $ITERATIONS"
    85         ;;
    86 cross-finally)
    87         CFAT="./cross-finally $ITERATIONS"
    88         CFAR=unsupported
    89         CPP=unsupported
    90         JAVA="java CrossFinally $ITERATIONS"
    91         PYTHON="./cross_finally.py $ITERATIONS"
     83raise-empty)
     84        CFAT="./throw-empty $ITERS_1M $STACK_HEIGHT"
     85# see resume-fixup-empty-r      CFAR="./resume-empty $ITERS_1M $STACK_HEIGHT"
     86        CPP="./throw-empty-cpp $ITERS_1M $STACK_HEIGHT"
     87        JAVA="java ThrowEmpty $ITERS_1M $STACK_HEIGHT"
     88        PYTHON="./throw-empty.py $ITERS_1M $STACK_HEIGHT"
    9289        ;;
    9390raise-detor)
    94         CFAT="./throw-detor $ITERATIONS $STACK_HEIGHT"
    95         CFAR="./resume-detor $ITERATIONS $STACK_HEIGHT"
    96         CPP="./throw-detor-cpp $ITERATIONS $STACK_HEIGHT"
     91        CFAT="./throw-detor $ITERS_1M $STACK_HEIGHT"
     92# N/A   CFAR="./resume-detor $ITERS_1M $STACK_HEIGHT"
     93        CPP="./throw-detor-cpp $ITERS_1M $STACK_HEIGHT"
    9794        JAVA=unsupported
    9895        PYTHON=unsupported
    9996        ;;
    100 raise-empty)
    101         CFAT="./throw-empty $ITERATIONS $STACK_HEIGHT"
    102         CFAR="./resume-empty $ITERATIONS $STACK_HEIGHT"
    103         CPP="./throw-empty-cpp $ITERATIONS $STACK_HEIGHT"
    104         JAVA="java ThrowEmpty $ITERATIONS $STACK_HEIGHT"
    105         PYTHON="./throw_empty.py $ITERATIONS $STACK_HEIGHT"
    106         ;;
    10797raise-finally)
    108         CFAT="./throw-finally $ITERATIONS $STACK_HEIGHT"
    109         CFAR="./resume-finally $ITERATIONS $STACK_HEIGHT"
     98        CFAT="./throw-finally $ITERS_1M $STACK_HEIGHT"
     99# N/A   CFAR="./resume-finally $ITERS_1M $STACK_HEIGHT"
    110100        CPP=unsupported
    111         JAVA="java ThrowFinally $ITERATIONS $STACK_HEIGHT"
    112         PYTHON="./throw_finally.py $ITERATIONS $STACK_HEIGHT"
     101        JAVA="java ThrowFinally $ITERS_1M $STACK_HEIGHT"
     102        PYTHON="./throw-finally.py $ITERS_1M $STACK_HEIGHT"
    113103        ;;
    114104raise-other)
    115         CFAT="./throw-other $ITERATIONS $STACK_HEIGHT"
    116         CFAR="./resume-other $ITERATIONS $STACK_HEIGHT"
    117         CPP="./throw-other-cpp $ITERATIONS $STACK_HEIGHT"
    118         JAVA="java ThrowOther $ITERATIONS $STACK_HEIGHT"
    119         PYTHON="./throw_other.py $ITERATIONS $STACK_HEIGHT"
     105        CFAT="./throw-other $ITERS_1M $STACK_HEIGHT"
     106# N/A   CFAR="./resume-other $ITERS_1M $STACK_HEIGHT"
     107        CPP="./throw-other-cpp $ITERS_1M $STACK_HEIGHT"
     108        JAVA="java ThrowOther $ITERS_1M $STACK_HEIGHT"
     109        PYTHON="./throw-other.py $ITERS_1M $STACK_HEIGHT"
     110        ;;
     111try-catch)
     112        CFAT="./try-catch $ITERS_1000M"
     113        CFAR="./try-resume $ITERS_1000M"
     114        CPP="./try-catch-cpp $ITERS_1000M"
     115        JAVA="java TryCatch $ITERS_1000M"
     116        PYTHON="./try-catch.py $ITERS_1000M"
     117        ;;
     118try-finally)
     119        CFAT="./try-finally $ITERS_1000M"
     120        CFAR=unsupported
     121        CPP=unsupported
     122        JAVA="java TryFinally $ITERS_1000M"
     123        PYTHON="./try-finally.py $ITERS_1000M"
     124        ;;
     125cond-match-all)
     126        CFAT="./cond-catch $ITERS_10M 1"
     127        CFAR="./cond-fixup $ITERS_10M 1"
     128        CPP="./cond-catch-cpp $ITERS_10M 1"
     129        JAVA="java CondCatch $ITERS_10M 1"
     130        PYTHON="./cond-catch.py $ITERS_10M 1"
     131        ;;
     132cond-match-none)
     133        CFAT="./cond-catch $ITERS_10M 0"
     134        CFAR="./cond-fixup $ITERS_10M 0"
     135        CPP="./cond-catch-cpp $ITERS_10M 0"
     136        JAVA="java CondCatch $ITERS_10M 0"
     137        PYTHON="./cond-catch.py $ITERS_10M 0"
     138        ;;
     139raise-fixup-empty)
     140        CFAT="./resume-fixup-empty-f $ITERS_10M $STACK_HEIGHT"
     141        CFAR="./resume-fixup-empty-r $ITERS_10M $STACK_HEIGHT"
     142        CPP="./resume-fixup-empty-cpp $ITERS_10M $STACK_HEIGHT"
     143        JAVA="java ResumeFixupEmpty $ITERS_10M $STACK_HEIGHT"
     144        PYTHON="./resume-fixup-empty.py $ITERS_10M $STACK_HEIGHT"
     145        ;;
     146raise-fixup-other)
     147        CFAT="./resume-fixup-other-f $ITERS_10M $STACK_HEIGHT"
     148        CFAR="./resume-fixup-other-r $ITERS_10M $STACK_HEIGHT"
     149        CPP="./resume-fixup-other-cpp $ITERS_10M $STACK_HEIGHT"
     150        JAVA="java ResumeFixupOther $ITERS_10M $STACK_HEIGHT"
     151        PYTHON="./resume-fixup-other.py $ITERS_10M $STACK_HEIGHT"
    120152        ;;
    121153*)
     
    126158
    127159case "$TEST_LANG" in
    128 cfa-t) CALL="$CFAT";;
    129 cfa-r) CALL="$CFAR";;
    130 cpp) CALL="$CPP";;
    131 java) CALL="$JAVA";;
    132 python) CALL="$PYTHON";;
    133 *)
    134         echo "No such language: $TEST_LANG" >&2
    135         exit 2
     160        cfa-t) CALL="$CFAT";;
     161        cfa-r) CALL="$CFAR";;
     162        cpp) CALL="$CPP";;
     163        java) CALL="$JAVA";;
     164        python) CALL="$PYTHON";;
     165        *)
     166                echo "No such language: $TEST_LANG" >&2
     167                exit 2
    136168        ;;
    137169esac
     
    140172
    141173if [ -n "$VIEW_FILE" ]; then
    142     grep -A 1 -B 0 "$CALL" "$VIEW_FILE" | sed -n -e 's!Run-Time (ns): !!;T;p'
    143     exit
     174        grep -A 1 -B 0 "$CALL" "$VIEW_FILE" | sed -n -e 's!Run-Time (ns): !!;T;p'
     175        exit
    144176fi
    145177
Note: See TracChangeset for help on using the changeset viewer.