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

  • Authors:
  • S. Harikrishnan;Rajeev Kumar

  • Affiliations:
  • Indian Institute of Technology Kharagpur, Kharagpur, India;Indian Institute of Technology Kharagpur, Kharagpur, India

  • Venue:
  • ACM SIGSOFT Software Engineering Notes
  • Year:
  • 2012

Quantified Score

Hi-index 0.01

Visualization

Abstract

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.