Changeset b51e389c for doc/theses/andrew_beach_MMath/performance.tex
- Timestamp:
- Jun 15, 2021, 4:17:05 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6071efc
- Parents:
- 2f19e03
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/performance.tex
r2f19e03 rb51e389c 6 6 7 7 Performance has been of secondary importance for most of this project. 8 Instead, the goal has been to get the features working. 9 The only performance 10 requirements is to ensure the exception tests for correctness ran in a reasonable 8 The driving for has been to get the features working, the only performance 9 requirements were to make sure the tests for correctness rain in a reasonable 11 10 amount of time. 12 Much of the implementation is still reasonable and could be used for similar prototypes. 13 Hence, 14 the work still has some use. 15 To get a rough idea about the \CFA implementation, tests are run on \CFA, C++ and Java, which have similar termination-handling exceptions. 16 Tests are also run on \CFA and uC++, which has similar resumption-handling exceptions. 11 Still this is an implementation others could use for similar prototypes and 12 so the results still have some use. 17 13 18 \section{Termination Comparison} 14 \section{Test Set-Up} 15 Tests will be run on \CFA, C++ and Java. 16 19 17 C++ is the most comparable language because both it and \CFA use the same 20 18 framework, libunwind. 21 In fact ,the comparison is almost entirely a quality of implementation19 In fact the comparison is almost entirely a quality of implementation 22 20 comparison. \CFA's EHM has had significantly less time to be optimized and 23 21 does not generate its own assembly. It does have a slight advantage in that 24 22 there are some features it does not handle. 25 23 26 The Java comparison is an opportunity to compare a managed memory model with unmanaged, 27 to see if there are any effects related to the exception model. 24 % Some languages I left out: 25 % Python: Its a scripting language, different 26 % uC++: Not well known and should the same results as C++, except for 27 % resumption which should be the same. 28 \todo{Can we find a good language to compare resumptions in.} 28 29 29 \subsection{Test Set-Up} 30 All tests are run inside a main loop that performs the test 31 repeatedly. This design avoids start-up or tear-down time from 30 All tests will be run inside a main loop which will perform the test 31 repeatedly. This is to avoid letting and start-up or tear-down time from 32 32 affecting the timing results. 33 A consequence is that tests cannot terminate the program, which does limit33 This also means that tests cannot terminate the program, which does limit 34 34 how tests can be implemented. There are catch-alls to keep unhandled 35 exceptions from terminating t ests.35 exceptions from terminating the program. 36 36 37 The exceptions used in this test are alwaysa new exception based off of38 the base exception. This requirement minimizes performance differences based37 The exceptions used in this test will always be a new exception based off of 38 the base exception. This should minimize and preformance differences based 39 39 on the object model. 40 Catch-alls are done by catching the root exception type (not using \Cpp's40 Catch-alls will be done by catching the root exception type (not using \Cpp's 41 41 \code{C++}{catch(...)}). 42 42 … … 44 44 hot. 45 45 46 \subsection{Tests} 47 The following tests capture the most important aspects of exception handling and should provide 48 a reasonable guide to programmers of where EHM costs occur. 49 46 \section{Tests} 50 47 \paragraph{Raise/Handle} 51 48 What is the basic cost to raise and handle an exception? 52 49 53 There are a number of factors that can effect this. 54 For \CFA this includes 50 There are a number of factors that can effect this, for \CFA this includes 55 51 the type of raise, 56 52 … … 65 61 This has the same set-up as the raise/handle test except the intermediate 66 62 stack frames contain either an object declaration with a destructor or a 67 @try@ statement with no handlers except and a @finally@clause.63 try statement with no handlers except for a finally clause. 68 64 69 65 \paragraph{Enter/Leave} … … 71 67 is thrown? 72 68 73 Th e test is a simple matter of entering69 This is the simplist pattern to test as it is a simple matter of entering 74 70 and leaving a try statement. 75 71 … … 78 74 79 75 \paragraph{Re-throw and Conditional-Catch} 80 How expen sive it is to run a non-exception type check for a handler?76 How expencive it is to run a non-exception type check for a handler? 81 77 82 78 In this case different languages approach this problem differently, either 83 79 through a re-throw or a conditional-catch. 84 Where \CFA uses its condition , other languages mustunconditionally80 Where \CFA uses its condition other languages will have to unconditionally 85 81 catch the exception then re-throw if the condition if the condition is false. 86 82 … … 90 86 % We could do a Cforall test without the catch all and a new default handler 91 87 % that does a catch all. 92 As a point of comparison ,one of the raise/handle tests (which one?) has88 As a point of comparison one of the raise/handle tests (which one?) has 93 89 same layout but never catches anything. 94 90 … … 104 100 %(I haven't actually figured out how to compare this, probably using something 105 101 %related to -fexceptions.) 106 107 108 \section{Resumption Comparison}109 % Some languages I left out:110 % Python: Its a scripting language, different111 % uC++: Not well known and should the same results as C++, except for112 % resumption which should be the same.113 \todo{Can we find a good language to compare resumptions in.}
Note: See TracChangeset
for help on using the changeset viewer.