Changeset ea593a3 for doc/theses
- Timestamp:
- Jul 1, 2021, 10:47:23 AM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 943bfad
- Parents:
- 262c600
- Location:
- doc/theses/andrew_beach_MMath
- Files:
-
- 24 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/performance.tex
r262c600 rea593a3 4 4 \textbf{Just because of the stage of testing there are design notes for 5 5 the 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?8 6 9 7 Performance has been of secondary importance for most of this project. … … 12 10 amount of time. 13 11 14 %\section{Termination Comparison}15 12 \section{Test Set-Up} 16 13 Tests will be run on \CFA, C++ and Java. … … 51 48 The should provide a guide as to where the EHM's costs can be found. 52 49 53 \paragraph{Raise/Handle} 54 What is the basic cost to raise and handle an exception? 50 Tests are run in \CFA, \Cpp and Java. 51 Not every test is run in every language, if the feature under test is missing 52 the test is skipped. These cases will be noted. 53 In addition to the termination tests for every language, 54 \CFA has a second set of tests that test resumption. These are the same 55 except that the raise statements and handler clauses are replaced with the 56 resumption variants. 55 57 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} 59 The first group of tests involve setting up 60 So there is three layers to the test. The first is set up and a loop, which 61 configures the test and then runs it repeatedly to reduce the impact of 62 start-up and shutdown on the results. 63 Each iteration of the main loop 64 \begin{itemize} 65 \item Empty Function: 66 The repeating function is empty except for the necessary control code. 67 \item Destructor: 68 The repeating function creates an object with a destructor before calling 69 itself. 70 (Java is skipped as it does not destructors.) 71 \item Finally: 72 The repeating function calls itself inside a try block with a finally clause 73 attached. 74 (\Cpp is skipped as it does not have finally clauses.) 75 \item Other Handler: 76 The repeating function calls itself inside a try block with a handler that 77 will not match the raised exception. (But is of the same kind of handler.) 78 \end{itemize} 58 79 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} 81 The next group measures the cost of a try statement when no exceptions are 82 raised. The test is set-up, then there is a loop to reduce the impact of 83 start-up and shutdown on the results. 84 In each iteration, a try statement is executed. Entering and leaving a loop 85 is all the test wants to do. 86 \begin{itemize} 87 \item Handler: 88 The try statement has a handler (of the matching kind). 89 \item Finally: 90 The try statement has a finally clause. 91 \end{itemize} 63 92 64 \paragraph{Unwinding} 65 Isolating the unwinding of the stack as much as possible. 66 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. 70 71 \paragraph{Enter/Leave} 72 What is the cost of entering and leaving a try block, even if no exception 73 is thrown? 74 75 This test is a simple pattern of entering 76 and leaving a try statement. 77 78 The only tunables here are which clauses are attached to the try block: 79 termination handlers, resumption handlers and finally clauses. 80 81 \paragraph{Re-throw and Conditional-Catch} 82 How expensive it is to run a non-exception type check for a handler? 83 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. 88 89 The set up is as follows: main loop, a catch-all exception handler, 90 a conditional catch and then the raise. 91 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. 96 97 The main tunable in this test is how often the conditional-catch matches. 93 \paragraph{Conditional Matching} 94 This group of tests checks the cost of conditional matching. 95 Only \CFA implements the language level conditional match, 96 the other languages must mimic with an ``unconditional" match (it still 97 checks the exception's type) and conditional re-raise. 98 \begin{itemize} 99 \item Catch All: 100 The condition is always true. (Always matches or never re-raises.) 101 \item Catch None: 102 The condition is always false. (Never matches or always re-raises.) 103 \end{itemize} 98 104 99 105 %\section{Cost in Size}
Note: See TracChangeset
for help on using the changeset viewer.