摘要:
In aspect-oriented execution-environments, aspect instances represent the state that is shared between multiple invocations of advice. Instantiation policies are responsible for retrieving the correct aspect instance for a specific execution of advice. Because this retrieval potentially happens many times during the execution of a program, it should be fast. In previous work, we have developed a unified model of aspect-instantiation policies that describes the semantics of in- stantiation policies independent of implementation details such as the underlying data structures. Strategies to optimise the execution speed of aspect-instance retrieval using JIT -compilation have been presented in previous work by Martin Zandberg. For specific instantiation-policy semantics, these strategies generate optimised machine code for the look-up procedure. The choice of data structures used to store the aspect instances is mostly left as an implementation detail. This choice, however, affects the execution speed of aspect-instance look-up and the memory footprint of the application. In this thesis, we evaluate different data structures for use as storage for aspect instances with respect to look-up speed and memory usage. Based on a benchmark, we suggest a two-level approach to implement aspect-instance storage: on a baseline level, data structures such as arrays, hash tables and prefix trees provide a widely applicable, but still fast solution, while on a second level, highly specialised data structures and access algorithms allow for even faster retrieval in certain special cases.