Table of Contents Author Guidelines Submit a Manuscript
Scientific Programming
Volume 10, Issue 1, Pages 19-33

NINJA: Java for High Performance Numerical Computing

José E. Moreira,1 Samuel P. Midkiff,1 Manish Gupta,1 Peng Wu,1 George Almasi,1 and Pedro Artigas2

1IBM Thomas J. Watson Research Center, Yorktown Heights, NY 10598-0218, USA
2School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213-3891, USA

Received 22 April 2002; Accepted 22 April 2002

Copyright © 2002 Hindawi Publishing Corporation. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.


When Java was first introduced, there was a perception that its many benefits came at a significant performance cost. In the particularly performance-sensitive field of numerical computing, initial measurements indicated a hundred-fold performance disadvantage between Java and more established languages such as Fortran and C. Although much progress has been made, and Java now can be competitive with C/C++ in many important situations, significant performance challenges remain. Existing Java virtual machines are not yet capable of performing the advanced loop transformations and automatic parallelization that are now common in state-of-the-art Fortran compilers. Java also has difficulties in implementing complex arithmetic efficiently. These performance deficiencies can be attacked with a combination of class libraries (packages, in Java) that implement truly multidimensional arrays and complex numbers, and new compiler techniques that exploit the properties of these class libraries to enable other, more conventional, optimizations. Two compiler techniques, versioning and semantic expansion, can be leveraged to allow fully automatic optimization and parallelization of Java code. Our measurements with the NINJA prototype Java environment show that Java can be competitive in performance with highly optimized and tuned Fortran code.