source: doc/theses/andrew_beach_MMath/performance.tex @ b51e389c

ADTast-experimentalenumforall-pointer-decayjacob/cs343-translationnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since b51e389c was b51e389c, checked in by Andrew Beach <ajbeach@…>, 3 years ago

Revert "proofread Andrew's implement, performance and future chapters", changes saved locally.

This reverts commit b6749fdf08185c0beb48a79dbf340a15f5b3b943.

  • Property mode set to 100644
File size: 4.1 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.}
6
7Performance has been of secondary importance for most of this project.
[b51e389c]8The driving for has been to get the features working, the only performance
9requirements were to make sure the tests for correctness rain in a reasonable
[dac16a0]10amount of time.
[b51e389c]11Still this is an implementation others could use for similar prototypes and
12so the results still have some use.
13
14\section{Test Set-Up}
15Tests will be run on \CFA, C++ and Java.
[dac16a0]16
17C++ is the most comparable language because both it and \CFA use the same
18framework, libunwind.
[b51e389c]19In fact the comparison is almost entirely a quality of implementation
[dac16a0]20comparison. \CFA's EHM has had significantly less time to be optimized and
21does not generate its own assembly. It does have a slight advantage in that
22there are some features it does not handle.
23
[b51e389c]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.}
[dac16a0]29
[b51e389c]30All tests will be run inside a main loop which will perform the test
31repeatedly. This is to avoid letting and start-up or tear-down time from
[dac16a0]32affecting the timing results.
[b51e389c]33This also means that tests cannot terminate the program, which does limit
[dac16a0]34how tests can be implemented. There are catch-alls to keep unhandled
[b51e389c]35exceptions from terminating the program.
[dac16a0]36
[b51e389c]37The exceptions used in this test will always be a new exception based off of
38the base exception. This should minimize and preformance differences based
[dac16a0]39on the object model.
[b51e389c]40Catch-alls will be done by catching the root exception type (not using \Cpp's
[dac16a0]41\code{C++}{catch(...)}).
42
43Tests run in Java were not warmed because exception code paths should not be
44hot.
45
[b51e389c]46\section{Tests}
[dac16a0]47\paragraph{Raise/Handle}
48What is the basic cost to raise and handle an exception?
49
[b51e389c]50There are a number of factors that can effect this, for \CFA this includes
[dac16a0]51the type of raise,
52
53Main loop, pass through a catch-all, call through some empty helper functions
54to put frames on the stack then raise and exception.
55\todo{Raise/Handle (or a similar test) could also test how much it costs to
56search over things, not sure if that is a useful test.}
57
58\paragraph{Unwinding}
59Isolating the unwinding of the stack as much as possible.
60
61This has the same set-up as the raise/handle test except the intermediate
62stack frames contain either an object declaration with a destructor or a
[b51e389c]63try statement with no handlers except for a finally clause.
[dac16a0]64
65\paragraph{Enter/Leave}
66What is the cost of entering and leaving a try block, even if no exception
67is thrown?
68
[b51e389c]69This is the simplist pattern to test as it is a simple matter of entering
[dac16a0]70and leaving a try statement.
71
72The only tunables here are which clauses are attached to the try block:
73termination handlers, resumption handlers and finally clauses.
74
75\paragraph{Re-throw and Conditional-Catch}
[b51e389c]76How expencive it is to run a non-exception type check for a handler?
[dac16a0]77
78In this case different languages approach this problem differently, either
79through a re-throw or a conditional-catch.
[b51e389c]80Where \CFA uses its condition other languages will have to unconditionally
[dac16a0]81catch the exception then re-throw if the condition if the condition is false.
82
83The set up is as follows: main loop, a catch-all exception handler,
84a conditional catch and then the raise.
85
86% We could do a Cforall test without the catch all and a new default handler
87% that does a catch all.
[b51e389c]88As a point of comparison one of the raise/handle tests (which one?) has
[dac16a0]89same layout but never catches anything.
90
91The main tunable in this test is how often the conditional-catch matches.
92
93%\section{Cost in Size}
94%Using exceptions also has a cost in the size of the executable.
95%Although it is sometimes ignored
96%
97%There is a size cost to defining a personality function but the later problem
98%is the LSDA which will be generated for every function.
99%
100%(I haven't actually figured out how to compare this, probably using something
101%related to -fexceptions.)
Note: See TracBrowser for help on using the repository browser.