August 24, 2006

Efficient Layer Activation for Switching Context-dependent Behavior

This is a paper that I have written together with Robert Hirschfeld and Wolfgang De Meuter, and we are going to present it at the Joint Modular Languages Conference (JMLC'06) in Oxford next month. The paper discusses how the CLOS Metaobject Protocol is used to implement the features of ContextL and presents a benchmark that shows that ContextL is quite efficient - not significantly worse than CLOS, which itself can be implemented very efficiently. So context-oriented programming does not seem to place a significant burden on applications in this regard.

The benchmark is based on an example that is frequently used to discuss aspect-oriented programming, especially control-flow-related features like the cflow construct in AspectJ. In our paper, we do not use an aspect-oriented solution, but obviously one based on context-oriented programming. That solution requires repeated activations and deactivations of layers, so this is indeed a useful benchmark for ContextL. These repeated activations and deactivations do not add any significant overhead to a similar program that does not activate or deactivate layers at all. To the contrary, in CMUCL and SBCL, the runs with repeated activations / deactivations are actually faster than the ones without. This means that other factors play a more important role with regard to efficiency. The benchmark is part of the ContextL release, so you can run it in your own environment.

The paper uses a Java-style syntax instead of the original Lisp syntax. We have decided to do so to make the paper more accessible to non-Lispers. However, I will use the original ContextL version for the presentation at the conference.

The paper can be downloaded from my website.

No comments: