In the last few years the interest in reflection has grown and many modem 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.

SmartMethod: an Efficient Replacement for Method / W. Cazzola - In: Proceedings of the 2004 ACM Symposium on Applied Computing (SAC) : Nicosia, Cyprus, March 14-17, 2004 / Lorie M. Liebrock. - New York : ACM Press, 2004. - ISBN 1581138121. - pp. 1305-1309 (( convegno ACM Symposium on Applied Computing - SAC'04 tenutosi a Nicosia, Cyprus nel 2004.

SmartMethod: an Efficient Replacement for Method

W. Cazzola
Primo
2004

Abstract

In the last few years the interest in reflection has grown and many modem 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.
Java; Java Core Reflection Library; Optimization; Reflection
Settore INF/01 - Informatica
Book Part (author)
File in questo prodotto:
Non ci sono file associati a questo prodotto.
Pubblicazioni consigliate

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/2434/10280
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 6
  • ???jsp.display-item.citation.isi??? ND
social impact