Space efficient non-constant time multi-method dispatch in object oriented systems

Autor: S. Harikrishnan, Rajeev Kumar
Rok vydání: 2012
Předmět:
Zdroj: ACM SIGSOFT Software Engineering Notes. 37:1-6
ISSN: 0163-5948
DOI: 10.1145/2108144.2108153
Popis: Multi-method dispatch in object oriented programs provides additional expressibility, readability and elegance over single dispatch languages. Optimizing multi-method dispatch is a central issue in compilers that support multi-methods. Existing constant time dispatch techniques for multi-methods keep either a lookup table or a lookup tree after compressing the same, the size of which can still be large if compression is not effective. In this paper, we propose a space efficient non-constant time technique (each method address should be computed - rather than being looked up) for multi-method dispatch with single inheritance type hierarchies. The method table containing all the multi-method signatures is the only data structure kept at run time. The table is arranged by sorting on argument position to expedite method search during dispatch. Heuristics is used during method search such that those methods which are not potential candidates are not included in the search. The proposed technique saves space significantly while the dispatch time grew higher compared to existing techniques. When multi-method counts were within practical bounds, the proposed technique was found to offer dispatch time similar to existing techniques.
Databáze: OpenAIRE