Comparison of Java and .NET reflection mechanisms for dynamic module loading: a performance benchmark study

Main Article Content

Michał Mazur

s97677@pollub.edu.pl

https://orcid.org/0009-0009-3923-8669
Sebastian Maruszak

s98053@pollub.edu.pl

Marek Miłosz

m.milosz@pollub.pl

https://orcid.org/0000-0002-5898-815X

Abstract


This paper presents an experimental performance analysis of dynamic module loading via reflection on the Java Virtual Machine (JVM) and the .NET Common Language Runtime (CLR). Three cold-loading benchmark scenarios are defined and executed with N=1000 post-warm-up iterations each: (A) Java URLClassLoader (non-modular JAR), (B) Java JPMS ModuleLayer (modular JAR), and (C) .NET AssemblyLoadContext. Each iteration measures four consecutive phases: module loading, type resolution, instance creation, and method invocation. After JIT warm-up (W=50 iterations) and IQR-based outlier removal, .NET AssemblyLoadContext achieves the lowest total mean time of 0.419 +- 0.104 ms, whereas Java JPMS incurs the highest mean of 1.299 +- 0.532 ms driven primarily by ModuleLayer construction (5.2x overhead vs. URLClassLoader). .NET type resolution is 20.9x faster than Java URLClassLoader (0.030 ms vs. 0.626 ms). Non-parametric statistical analysis (Mann–Whitney U, Cohen’s d: 0.66–2.26) confirms that all pairwise differences are highly significant (p<0.001). Cached-reflection baselines show that both platforms reduce to sub-10 us once class/assembly metadata is reused.


Keywords:

dynamic module loading, Java, .NET, performance benchmarking, URLClassLoader, JPMS

Sustainable Development Goal (SDG)

  • Industry, Innovation, Technology and Infrastructure

References

Article Details

Mazur, M., Maruszak, S., & Miłosz, M. (2026). Comparison of Java and .NET reflection mechanisms for dynamic module loading: a performance benchmark study. Journal of Computer Sciences Institute, 40, 213-217. https://doi.org/10.35784/jcsi.9676