EUVIMEDObjevte EUVIMED
Crossref

Characterizing the Usage and Performance Impact of Java Reflection: An Empirical Study

Miguel Garcia, Francisco Ortin

ACM Transactions on Software Engineering and Methodology · 2026-05-21

DOI: 10.1145/3815583 ↗

At a glance

Journal article in ACM Transactions on Software Engineering and Methodology, published online on 2026-05-21. Written by Miguel Garcia and 1 co-authors. 64 references.

AbstraktBibliografické údajeCiteRelated studies

Abstract (original language)

Reflection enables programs to dynamically inspect and manipulate their own structure, providing flexibility in evolving runtime environments. Java offers this capability through its Reflection API, which supports dynamic object creation, field access, method invocation, and metadata inspection. Despite these advantages, reflection complicates static analysis and may introduce runtime overhead, motivating a comprehensive empirical investigation of its practical use and cost. We analyze reflection usage across 59.4 million Java files from all open-source Java repositories on GitHub, reporting primitive-level statistics. Our results show that reflection is widely adopted but typically confined to specific components, with type retrieval and name inspection dominating usage, while advanced features such as behavioral reflection and generic type inspection also appear in a non-negligible number of repositories. We further measure execution-time and memory overhead across five major JVM implementations on Windows and Linux, considering single-threaded and multithreaded scenarios, and distinguishing startup from steady-state performance under JIT optimization. The results identify clear cost tiers among reflection primitives, substantial steady-state and JVM-dependent overheads, preserved parallel scalability despite high absolute costs, and potentially dramatic slowdowns when reflection is applied pervasively.

Cite

APA

Garcia, M., & Ortin, F. (2026). Characterizing the Usage and Performance Impact of Java Reflection: An Empirical Study. ACM Transactions on Software Engineering and Methodology. https://doi.org/10.1145/3815583

Vancouver

Garcia M, Ortin F. Characterizing the Usage and Performance Impact of Java Reflection: An Empirical Study. ACM Transactions on Software Engineering and Methodology. 2026. doi:10.1145/3815583

BibTeX
@article{Garcia2026,
  author = {Garcia, Miguel and Ortin, Francisco},
  title = {Characterizing the Usage and Performance Impact of Java Reflection: An Empirical Study},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2026},
  doi = {10.1145/3815583}
}
Start for free →