Performance of an OO compute kernel on the JVM: revisiting Java as a language for scientific computing applications

The study of Java as a programming language for scientific computing is warranted by simpler, more extensible and more easily maintainable code. Previous work on refactoring a C++ scientific computing code base to follow best practises of object-oriented software development revealed a coupling of such practises and considerable slowdowns due to indirections introduced by abstractions. In this paper, we explore how Java's JIT compiler handle such abstraction-induced indirection using a typical scientific computing compute kernel extracted from a linear solver written in C++. We find that the computation times for large workloads on one machine can be on-pair for C++ and Java. However, for distributed computations, a better parallelisation strategy needs to be found for non-blocking communication. We also report on the impact on performance for common "gripes": garbage collection, array bounds checking, and dynamic binding.

[1]  Pedro Arduino,et al.  Localized tensor-based solvers for interactive finite element applications using C++ and Java , 2003 .

[2]  Ronald F. Boisvert,et al.  Developing numerical libraries in Java , 1998, Concurr. Pract. Exp..

[3]  Samuel P. Midkiff,et al.  A comparison of Java, C/C++, and FORTRAN for numerical computing , 1998 .

[4]  Bowen Alpern,et al.  Efficient implementation of Java interfaces: Invokeinterface considered harmless , 2001, OOPSLA '01.

[5]  Rajat P. Garg,et al.  A Prototype Computational Fluid Dynamics Case Study in Java , 1997, Concurr. Pract. Exp..

[6]  R ExpósitoRoberto,et al.  Java in the High Performance Computing arena , 2013 .

[7]  Denis Caromel,et al.  Current State of Java for HPC , 2008 .

[8]  Robert C. Martin Agile Software Development, Principles, Patterns, and Practices , 2002 .

[9]  Sverker Holmgren,et al.  Communication-Efficient Algorithms for Numerical Quantum Dynamics , 2010, PARA.

[10]  G. P. Nikishkov,et al.  Comparison of C and Java performance in finite element computations , 2003 .

[11]  Mark Baker,et al.  University of Portsmouth Portsmouth Hants United Kingdom Po1 2up a Comparative Study of Java and C Performance in Two Large-scale Parallel Applications , 2022 .

[12]  Ebba Þóra Hvannberg,et al.  Impact of Code Refactoring Using Object-Oriented Methodology on a Scientific Computing Application , 2014, 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation.

[13]  Craig Chambers,et al.  Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches , 1991, ECOOP.

[14]  Sabela Ramos,et al.  Java in the High Performance Computing arena: Research, practice and experience , 2013, Sci. Comput. Program..

[15]  Rodrigo A. Vivanco,et al.  Scientific computing with Java and C++: a case study using functional magnetic resonance neuroimages , 2005, Softw. Pract. Exp..

[16]  Samuel P. Midkiff,et al.  From flop to megaflops: Java for technical computing , 1998, TOPL.

[17]  James C. Schatzman Writing high-performance Java code that runs as fast as Fortran, C, or C++ , 2001, ITCom.

[18]  Ion Gh. Rosca,et al.  Evaluating Java performance for linear algebra numerical computations , 2011, WCIT.

[19]  Geoffrey Phipps Comparing Observed Bug and Productivity Rates for Java and C++ , 1999, Softw. Pract. Exp..

[20]  James O. Coplien,et al.  Curiously recurring template patterns , 1995 .

[21]  James Demmel,et al.  Numerical evaluation of the Communication-Avoiding Lanczos algorithm , 2012 .

[22]  Jeffrey M. Squyres,et al.  Design and implementation of Java bindings in Open MPI , 2016, Parallel Comput..

[23]  H. Johnson,et al.  A comparison of 'traditional' and multimedia information systems development practices , 2003, Inf. Softw. Technol..

[24]  Tobias Wrigstad,et al.  Tracing dynamic features in python programs , 2014, MSR 2014.

[25]  M. J. D. Mallett A Molecular Dynamics Computer Simulation Performance Comparison of Java Versus C , 2001 .

[26]  Tobias Wrigstad,et al.  Measuring polymorphism in python programs , 2015, DLS.

[27]  J. Mark Bull,et al.  Benchmarking Java against C and Fortran for scientific applications , 2001, JGI '01.

[28]  Sverker Holmgren,et al.  An Implementation Framework for Solving High-Dimensional PDEs on Massively Parallel Computers , 2010 .