The Impact of Branch Prediction on Control Structures for Dynamic Dispatch in Java - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Rapport (Rapport De Recherche) Année : 2002

The Impact of Branch Prediction on Control Structures for Dynamic Dispatch in Java

Dayong Gu
  • Fonction : Auteur
Karel Driesen
  • Fonction : Auteur

Résumé

Dynamic dispatch, or late binding of function calls, is a salient feature of object-oriented programming languages like C++ and Java. The target of a dispatched call changes according to the type of the object receiving the call. Due to inheritance the exact type is unknown at compile time, and therefore dispatch must occur in general at run time, implying a cost to the use of object-oriented programming languages. In previous work, we measured the performance of various equivalent non-object-oriented control structures to determine if dispatch cost can be reduced by translation. Measurements on a variety of virtual machines and hardware platforms show that alternative control structures are useful for a low number of expected types (low degrees of polymorphism). However, the gains differ substantially for different type patterns, even when the number of types is constant. The difference is likely to be caused by a processor's branch predictor, which guess the outcome of branches involved in dynamic dispatch . In this paper, we simulate branch predictors of Athlon and Pentium in order to validate this insight. The results show that branch prediction accuracy is indeed responsible. For successful optimization it is therefore not sufficient to guess the number of types occurring in a call. The type pattern should also be taken into account.

Domaines

Autre [cs.OH]
Fichier principal
Vignette du fichier
RR-4547.pdf (833.89 Ko) Télécharger le fichier
Loading...

Dates et versions

inria-00072041 , version 1 (23-05-2006)

Identifiants

  • HAL Id : inria-00072041 , version 1

Citer

Dayong Gu, Olivier Zendra, Karel Driesen. The Impact of Branch Prediction on Control Structures for Dynamic Dispatch in Java. [Research Report] RR-4547, INRIA. 2002, pp.12. ⟨inria-00072041⟩
230 Consultations
160 Téléchargements

Partager

Gmail Facebook X LinkedIn More