Efficiency of subtype test in object oriented languages with generics

  • Authors:
  • Alexandre Terrasa;Jean Privat

  • Affiliations:
  • Université du Québec à Montréal;Université du Québec à Montréal

  • Venue:
  • Proceedings of the 8th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

In a programming language, the choice of a generics typing policy impacts both typing test semantics and type safety. In this paper, we compare the cost of the generic policy chosen and analyze its impacts on the subtype test performance. To make this comparison we implement two compilers for the Nit language. One applies covariant policy using a homogeneous implementation and the second applies an erased policy and implementation. We compare the time efficiency of our solution against engines for C++, C#, Eiffel, Java and Scala. Results show that our implementations give the best performances compared to existing solutions. We also compare covariant and erased policies on existing Nit programs using our two compilers. Results show that covariance does not imply significant overhead regarding subtype test performances. Due to the small difference between the costs of the different policies, the choice of a policy by a language designer should not be influenced by performance considerations.