OO Optimizations
- Dead Class Elimination: remove unused classes.
- Merge Class: merge classes with a subclass if there is only one subclass and it has no subclasses. Can do it recursively
- Dead method Elimination: remove unused methods
-
- Type propagation: propagate type data from creation out through system as much as possible so that the compiler knows more exactly what the type of a given object is.
- Non-virtual: turn methods that are not overridden into no virtual methods.
-
- Static calls: when you know the exact type of an object make static calls where possible.
- Inline: inline simple static calls. Either at every call or at some important calls.
- Remove 100% Inlined method:
- Immutable Type: make immutable types into primitives.
-
- Tail calls: optimize all tail calls, by removing the stack or making a loop.
- Memory use:
- not given out -> local variables
- none circular object graph -> reference counting (compiler support lowers need to update)
- direct circularity -> owner/slave
- full circularity -> incremental garbage collection
jwalker@cs.oberlin.edu