EUVIMEDEUVIMED entdecken
Crossref

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

Miguel Garcia, Francisco Ortin

ACM Transactions on Software Engineering and Methodology · 21.05.2026

DOI: 10.1145/3815583 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 21.05.2026. Verfasst von Miguel Garcia und 1 weiteren Autor:innen. Die Arbeit nennt 64 Literaturangaben.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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.

Zitieren

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}
}
Kostenlos starten →