Changeset 2f19e03 for doc/theses/andrew_beach_MMath/performance.tex
- Timestamp:
- Jun 15, 2021, 12:28:48 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- b51e389c
- Parents:
- 4aba055 (diff), 4f1b8f3f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/performance.tex
r4aba055 r2f19e03 6 6 7 7 Performance has been of secondary importance for most of this project. 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 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 10 11 amount of time. 11 Still this is an implementation others could use for similar prototypes and 12 so the results still have some use. 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. 13 17 14 \section{Test Set-Up} 15 Tests will be run on \CFA, C++ and Java. 16 18 \section{Termination Comparison} 17 19 C++ is the most comparable language because both it and \CFA use the same 18 20 framework, libunwind. 19 In fact the comparison is almost entirely a quality of implementation21 In fact, the comparison is almost entirely a quality of implementation 20 22 comparison. \CFA's EHM has had significantly less time to be optimized and 21 23 does not generate its own assembly. It does have a slight advantage in that 22 24 there are some features it does not handle. 23 25 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.} 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. 29 28 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 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 32 32 affecting the timing results. 33 This also means that tests cannot terminate the program, which does limit33 A consequence is 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 he program.35 exceptions from terminating tests. 36 36 37 The exceptions used in this test will always bea new exception based off of38 the base exception. This should minimize and preformance differences based37 The exceptions used in this test are always a new exception based off of 38 the base exception. This requirement minimizes performance differences based 39 39 on the object model. 40 Catch-alls will be done by catching the root exception type (not using \Cpp's40 Catch-alls are done by catching the root exception type (not using \Cpp's 41 41 \code{C++}{catch(...)}). 42 42 … … 44 44 hot. 45 45 46 \section{Tests} 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 47 50 \paragraph{Raise/Handle} 48 51 What is the basic cost to raise and handle an exception? 49 52 50 There are a number of factors that can effect this, for \CFA this includes 53 There are a number of factors that can effect this. 54 For \CFA this includes 51 55 the type of raise, 52 56 … … 61 65 This has the same set-up as the raise/handle test except the intermediate 62 66 stack frames contain either an object declaration with a destructor or a 63 try statement with no handlers except for a finallyclause.67 @try@ statement with no handlers except and a @finally@ clause. 64 68 65 69 \paragraph{Enter/Leave} … … 67 71 is thrown? 68 72 69 Th is is the simplist pattern to test as it is a simple matter of entering73 The test is a simple matter of entering 70 74 and leaving a try statement. 71 75 … … 74 78 75 79 \paragraph{Re-throw and Conditional-Catch} 76 How expen cive it is to run a non-exception type check for a handler?80 How expensive it is to run a non-exception type check for a handler? 77 81 78 82 In this case different languages approach this problem differently, either 79 83 through a re-throw or a conditional-catch. 80 Where \CFA uses its condition other languages will have tounconditionally84 Where \CFA uses its condition, other languages must unconditionally 81 85 catch the exception then re-throw if the condition if the condition is false. 82 86 … … 86 90 % We could do a Cforall test without the catch all and a new default handler 87 91 % that does a catch all. 88 As a point of comparison one of the raise/handle tests (which one?) has92 As a point of comparison, one of the raise/handle tests (which one?) has 89 93 same layout but never catches anything. 90 94 … … 100 104 %(I haven't actually figured out how to compare this, probably using something 101 105 %related to -fexceptions.) 106 107 108 \section{Resumption Comparison} 109 % Some languages I left out: 110 % Python: Its a scripting language, different 111 % uC++: Not well known and should the same results as C++, except for 112 % 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.