# Changeset ea593a3

Ignore:
Timestamp:
Jul 1, 2021, 10:47:23 AM (11 months ago)
Branches:
enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr
Children:
Parents:
262c600
Message:

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

Location:
doc/theses/andrew_beach_MMath
Files:
 r262c600 \textbf{Just because of the stage of testing there are design notes for the tests as well as commentary on them.} \todo{Revisit organization of the performance chapter once tests are chosen.} % What are good tests for resumption? Performance has been of secondary importance for most of this project. amount of time. %\section{Termination Comparison} \section{Test Set-Up} Tests will be run on \CFA, C++ and Java. The should provide a guide as to where the EHM's costs can be found. \paragraph{Raise/Handle} What is the basic cost to raise and handle an exception? Tests are run in \CFA, \Cpp and Java. Not every test is run in every language, if the feature under test is missing the test is skipped. These cases will be noted. In addition to the termination tests for every language, \CFA has a second set of tests that test resumption. These are the same except that the raise statements and handler clauses are replaced with the resumption variants. There are a number of factors that can effect this. For \CFA this includes the type of raise, \paragraph{Raise and Handle} The first group of tests involve setting up So there is three layers to the test. The first is set up and a loop, which configures the test and then runs it repeatedly to reduce the impact of start-up and shutdown on the results. Each iteration of the main loop \begin{itemize} \item Empty Function: The repeating function is empty except for the necessary control code. \item Destructor: The repeating function creates an object with a destructor before calling itself. (Java is skipped as it does not destructors.) \item Finally: The repeating function calls itself inside a try block with a finally clause attached. (\Cpp is skipped as it does not have finally clauses.) \item Other Handler: The repeating function calls itself inside a try block with a handler that will not match the raised exception. (But is of the same kind of handler.) \end{itemize} Main loop, pass through a catch-all, call through some empty helper functions to put frames on the stack then raise and exception. \todo{Raise/Handle (or a similar test) could also test how much it costs to search over things, not sure if that is a useful test.} \paragraph{Cross Try Statement} The next group measures the cost of a try statement when no exceptions are raised. The test is set-up, then there is a loop to reduce the impact of start-up and shutdown on the results. In each iteration, a try statement is executed. Entering and leaving a loop is all the test wants to do. \begin{itemize} \item Handler: The try statement has a handler (of the matching kind). \item Finally: The try statement has a finally clause. \end{itemize} \paragraph{Unwinding} Isolating the unwinding of the stack as much as possible. This has the same set-up as the raise/handle test except the intermediate stack frames contain either an object declaration with a destructor or a try statement with no handlers except for a finally clause. \paragraph{Enter/Leave} What is the cost of entering and leaving a try block, even if no exception is thrown? This test is a simple pattern of entering and leaving a try statement. The only tunables here are which clauses are attached to the try block: termination handlers, resumption handlers and finally clauses. \paragraph{Re-throw and Conditional-Catch} How expensive it is to run a non-exception type check for a handler? In this case different languages approach this problem differently, either through a re-throw or a conditional-catch. Where \CFA uses its condition other languages will have to unconditionally catch the exception then re-throw if the condition if the condition is false. The set up is as follows: main loop, a catch-all exception handler, a conditional catch and then the raise. % We could do a Cforall test without the catch all and a new default handler % that does a catch all. As a point of comparison one of the raise/handle tests (which one?) has same layout but never catches anything. The main tunable in this test is how often the conditional-catch matches. \paragraph{Conditional Matching} This group of tests checks the cost of conditional matching. Only \CFA implements the language level conditional match, the other languages must mimic with an unconditional" match (it still checks the exception's type) and conditional re-raise. \begin{itemize} \item Catch All: The condition is always true. (Always matches or never re-raises.) \item Catch None: The condition is always false. (Never matches or always re-raises.) \end{itemize} %\section{Cost in Size}