Efficient Dispatch of Multimethods in Constant Time Using Dispatch Trees

Optimizing method dispatch is a central issue in object-oriented language implementation. Besides overall efficiency, a major requirement for some languages and applications is constant-time performance. In systems with multi-methods, these requirements are still harder to meet. The compressed dispatch table scheme, presented in (Amiel et al, OOPSLA 94), was the first to meet them. Its compression algorithm is based on the definition of "pole types". In this report, we investigate another structure, namely the dispatch tree, showing that it can also meet those requirements. We show that pole types can be used to compress dispatch trees, and we describe some optimizations of compressed dispatch trees. The resulting run-time structures are yet smaller than compressed dispatch tables.