Jul 1, 2021, 10:47:23 AM (3 years ago)
Andrew Beach <ajbeach@…>
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum

First draft of all the exception benchmarks. There is an issue with the Cforall linking.

24 added
1 edited


  • doc/theses/andrew_beach_MMath/performance.tex

    r262c600 rea593a3  
    44\textbf{Just because of the stage of testing there are design notes for
    55the tests as well as commentary on them.}
    6 \todo{Revisit organization of the performance chapter once tests are chosen.}
    7 % What are good tests for resumption?
    97Performance has been of secondary importance for most of this project.
    1210amount of time.
    14 %\section{Termination Comparison}
    1512\section{Test Set-Up}
    1613Tests will be run on \CFA, C++ and Java.
    5148The should provide a guide as to where the EHM's costs can be found.
    53 \paragraph{Raise/Handle}
    54 What is the basic cost to raise and handle an exception?
     50Tests are run in \CFA, \Cpp and Java.
     51Not every test is run in every language, if the feature under test is missing
     52the test is skipped. These cases will be noted.
     53In addition to the termination tests for every language,
     54\CFA has a second set of tests that test resumption. These are the same
     55except that the raise statements and handler clauses are replaced with the
     56resumption variants.
    56 There are a number of factors that can effect this.
    57 For \CFA this includes the type of raise,
     58\paragraph{Raise and Handle}
     59The first group of tests involve setting up
     60So there is three layers to the test. The first is set up and a loop, which
     61configures the test and then runs it repeatedly to reduce the impact of
     62start-up and shutdown on the results.
     63Each iteration of the main loop
     65\item Empty Function:
     66The repeating function is empty except for the necessary control code.
     67\item Destructor:
     68The repeating function creates an object with a destructor before calling
     70(Java is skipped as it does not destructors.)
     71\item Finally:
     72The repeating function calls itself inside a try block with a finally clause
     74(\Cpp is skipped as it does not have finally clauses.)
     75\item Other Handler:
     76The repeating function calls itself inside a try block with a handler that
     77will not match the raised exception. (But is of the same kind of handler.)
    59 Main loop, pass through a catch-all, call through some empty helper functions
    60 to put frames on the stack then raise and exception.
    61 \todo{Raise/Handle (or a similar test) could also test how much it costs to
    62 search over things, not sure if that is a useful test.}
     80\paragraph{Cross Try Statement}
     81The next group measures the cost of a try statement when no exceptions are
     82raised. The test is set-up, then there is a loop to reduce the impact of
     83start-up and shutdown on the results.
     84In each iteration, a try statement is executed. Entering and leaving a loop
     85is all the test wants to do.
     87\item Handler:
     88The try statement has a handler (of the matching kind).
     89\item Finally:
     90The try statement has a finally clause.
    64 \paragraph{Unwinding}
    65 Isolating the unwinding of the stack as much as possible.
    67 This has the same set-up as the raise/handle test except the intermediate
    68 stack frames contain either an object declaration with a destructor or a
    69 try statement with no handlers except for a finally clause.
    71 \paragraph{Enter/Leave}
    72 What is the cost of entering and leaving a try block, even if no exception
    73 is thrown?
    75 This test is a simple pattern of entering
    76 and leaving a try statement.
    78 The only tunables here are which clauses are attached to the try block:
    79 termination handlers, resumption handlers and finally clauses.
    81 \paragraph{Re-throw and Conditional-Catch}
    82 How expensive it is to run a non-exception type check for a handler?
    84 In this case different languages approach this problem differently, either
    85 through a re-throw or a conditional-catch.
    86 Where \CFA uses its condition other languages will have to unconditionally
    87 catch the exception then re-throw if the condition if the condition is false.
    89 The set up is as follows: main loop, a catch-all exception handler,
    90 a conditional catch and then the raise.
    92 % We could do a Cforall test without the catch all and a new default handler
    93 % that does a catch all.
    94 As a point of comparison one of the raise/handle tests (which one?) has
    95 same layout but never catches anything.
    97 The main tunable in this test is how often the conditional-catch matches.
     93\paragraph{Conditional Matching}
     94This group of tests checks the cost of conditional matching.
     95Only \CFA implements the language level conditional match,
     96the other languages must mimic with an ``unconditional" match (it still
     97checks the exception's type) and conditional re-raise.
     99\item Catch All:
     100The condition is always true. (Always matches or never re-raises.)
     101\item Catch None:
     102The condition is always false. (Never matches or always re-raises.)
    99105%\section{Cost in Size}
Note: See TracChangeset for help on using the changeset viewer.