source: doc/theses/andrew_beach_MMath/performance.tex@ 1d71208

ADT ast-experimental enum forall-pointer-decay jacob/cs343-translation new-ast-unique-expr pthread-emulation qualifiedEnum
Last change on this file since 1d71208 was 029cbc0, checked in by Andrew Beach <ajbeach@…>, 4 years ago

Andrew MMath: Performance feedback is a bit stranger as the content is still unknown. (5/6 files done.)

  • Property mode set to 100644
File size: 4.5 KB
RevLine 
[dac16a0]1\chapter{Performance}
2\label{c:performance}
3
4\textbf{Just because of the stage of testing there are design notes for
5the tests as well as commentary on them.}
[029cbc0]6\todo{Revisit organization of the performance chapter once tests are chosen.}
7% What are good tests for resumption?
[dac16a0]8
9Performance has been of secondary importance for most of this project.
[029cbc0]10Instead, the focus has been to get the features working. The only performance
11requirements is to ensure the tests for correctness run in a reasonable
[dac16a0]12amount of time.
[b51e389c]13
[029cbc0]14%\section{Termination Comparison}
[b51e389c]15\section{Test Set-Up}
16Tests will be run on \CFA, C++ and Java.
[dac16a0]17
18C++ is the most comparable language because both it and \CFA use the same
19framework, libunwind.
[029cbc0]20In fact, the comparison is almost entirely a quality of implementation
[dac16a0]21comparison. \CFA's EHM has had significantly less time to be optimized and
22does not generate its own assembly. It does have a slight advantage in that
23there are some features it does not handle.
24
[029cbc0]25Java is another very popular language with similar termination semantics.
26It is implemented in a very different environment, a virtual machine with
27garbage collection.
28It also implements the finally clause on try blocks allowing for a direct
29feature-to-feature comparison.
[dac16a0]30
[029cbc0]31All tests are run inside a main loop which will perform the test
32repeatedly. This is to avoids start-up or tear-down time from
[dac16a0]33affecting the timing results.
[029cbc0]34A consequence of this is that tests cannot terminate the program,
35which does limit how tests can be implemented.
36There are catch-alls to keep unhandled
37exceptions from terminating tests.
[dac16a0]38
[029cbc0]39The exceptions used in these tests will always be a exception based off of
40the base exception. This requirement minimizes performance differences based
[dac16a0]41on the object model.
[029cbc0]42Catch-alls are done by catching the root exception type (not using \Cpp's
[dac16a0]43\code{C++}{catch(...)}).
44
45Tests run in Java were not warmed because exception code paths should not be
46hot.
47
[b51e389c]48\section{Tests}
[029cbc0]49The following tests were selected to test the performance of different
50components of the exception system.
51The should provide a guide as to where the EHM's costs can be found.
52
[dac16a0]53\paragraph{Raise/Handle}
54What is the basic cost to raise and handle an exception?
55
[029cbc0]56There are a number of factors that can effect this.
57For \CFA this includes the type of raise,
[dac16a0]58
59Main loop, pass through a catch-all, call through some empty helper functions
60to 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
62search over things, not sure if that is a useful test.}
63
64\paragraph{Unwinding}
65Isolating the unwinding of the stack as much as possible.
66
67This has the same set-up as the raise/handle test except the intermediate
68stack frames contain either an object declaration with a destructor or a
[b51e389c]69try statement with no handlers except for a finally clause.
[dac16a0]70
71\paragraph{Enter/Leave}
72What is the cost of entering and leaving a try block, even if no exception
73is thrown?
74
[029cbc0]75This test is a simple pattern of entering
[dac16a0]76and leaving a try statement.
77
78The only tunables here are which clauses are attached to the try block:
79termination handlers, resumption handlers and finally clauses.
80
81\paragraph{Re-throw and Conditional-Catch}
[029cbc0]82How expensive it is to run a non-exception type check for a handler?
[dac16a0]83
84In this case different languages approach this problem differently, either
85through a re-throw or a conditional-catch.
[b51e389c]86Where \CFA uses its condition other languages will have to unconditionally
[dac16a0]87catch the exception then re-throw if the condition if the condition is false.
88
89The set up is as follows: main loop, a catch-all exception handler,
90a 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.
[b51e389c]94As a point of comparison one of the raise/handle tests (which one?) has
[dac16a0]95same layout but never catches anything.
96
97The main tunable in this test is how often the conditional-catch matches.
98
99%\section{Cost in Size}
100%Using exceptions also has a cost in the size of the executable.
101%Although it is sometimes ignored
102%
103%There is a size cost to defining a personality function but the later problem
104%is the LSDA which will be generated for every function.
105%
106%(I haven't actually figured out how to compare this, probably using something
107%related to -fexceptions.)
[029cbc0]108
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
114%\section{Resumption Comparison}
115\todo{Can we find a good language to compare resumptions in.}
Note: See TracBrowser for help on using the repository browser.