Optimizing Java Linpack

[ index | benchmarks | speed | size | maintainability | rules | tools | compilers ]


I took the original Java Linpack benchmark, by Jack Dongarra and Reed Wade, and applied some of the optimizations from my Java Optimization page: The optimized code is typically 10-20% faster when run on the JDK interpreter, depending on the architecture, but may not show any improvement at all when run under a just-in-time compiler. Here are some sample MFlops ratings (higher is better), running the original and optimized code. The first three results are for the JDK on different machines, while the last four results compare different just-in-time compilers on the same machine.

MachineOriginalOptimized
Sparc5/85, JDK 1.0.20.250.30
HP 712/60, JDK 1.0.20.150.16
DX4-120, JDK 1.0.20.220.26
DX4-120, Cafe 1.511.241.32
DX4-120, Visual Cafe PR 22.782.84
DX4-120, Netscape Navigator 3.01.871.92
DX4-120, Internet Explorer 3.03.213.21

Note that the benchmark is run 10 times to reduce clock granularity problems.

To try it for yourself, use the applet below. Depending on machine load, you may need to take the best of several runs.

[Your browser doesn't run Java]

Note: with more modern JITs, the optimized version is actually slower than the original (thanks to everyone who pointed this out :->). I suspect that putting the unrolled loop back and/or using JIT abs methods would restore its performance advantage. Consider this a salutory reminder of the dangers of optimization! [NEW]

[Counter]
http://www.cs.cmu.edu/~jch/java/linpack.html Optimizing Java Linpack
Last modified: Wed 18 Mar 1998 Copyright © 1996, 1997 Jonathan Hardwick