DesignPerformance

From JQuantLib

Jump to: navigation, search

Problem

Performance of numerical Java applications can be poor.


Solution

First of all, performance is a subject that becomes impossible to debate if we consider till the last millisecond. It's even more confused if you take the exact same code (or almost the exact same code!) written in Java and C++ and run on different hardware platforms: results can be totally different on different platforms. I prefer to adopt a certain "threshold" of I'd say, 30% which means that a difference of 30% or less means we dont have precision enough to compare and both should be considered similar.

Taking the previous paragraph into consideration, Java code can be compared with equivalent C++ code:


In order to address the major issues, we evaluated these technologies:

  • FastUtil package which offers Colletions of primitive types. This is where Java code can beat C++ code due to the way C++ handles pointers as opposed to the way Java handles arrays.
  • JAL package which mimics most of C++ STL functionality, providing fast algorithms on arrays of primitive types, which perform much faster than arrays of Objects.
  • Colt package which is an excellent class library used by CERN. In particular Colt has modified versions of JAL and FastUtil in it.
  • Parallel Colt package is a re-implementation of Colt package and aims to take advantage of modern multi-core CPUs.


We have chosen Colt because:

  • Colt is a well implemented, fast and stable mathematical, linear algebra library;
  • Colt has JAL somewhat 'integrated';
  • Colt can be 'upgraded' more or less easily to Parallel Colt;


Other options:

  • FastUtil can be used in places where functionalities from Java Collections Framework are really important.


See also:


RichardGomes 14:24, 10 February 2008 (UTC)

Personal tools