SmartMethod: an efficient replacement for method

  • Authors:
  • Walter Cazzola

  • Affiliations:
  • Università degli Studi di Milano

  • Venue:
  • Proceedings of the 2004 ACM symposium on Applied computing
  • Year:
  • 2004

Quantified Score

Hi-index 0.01

Visualization

Abstract

In the last few years the interest in reflection has grown and many modern programming languages/architectures have provided the programmer with reflective mechanisms. As well as any other novelty also reflection has detractors. They rightly or wrongly accuse reflection to be too inefficient to be used with real profit. In this work, we have investigated about the performance of Java reflection library (especially of the class Method and of its method invoke) and realized a mechanism which improves its performances. Our mechanism consists of a class, named SmartMethod and of a parser contributing to transform reflective invocations into direct call carried out by the standard invocation mechanism of Java. The SmartMethod class is compliant --- that is, it provides exactly the same services ---, with the class Method of the standard Java core reflection library but it provides a more efficient reflective method invocation.