Skip to main content

newbie question on performance 1.4.0 vs 1.5.0

3 replies [Last post]
m68_1
Offline
Joined: 2006-10-02
Points: 0

hi all,

I am a newbie in this forum and have a question.

I noticed a significant performance improvement with version 1.5.0(and 1.6.0 beta2) vs 1.4.0, a simple fibonacci 45 calculation took 13 seconds on my 3.0GHZ Dell running 1.5.0, where it took much longer under 1.4.0.

can anyone shed any light why?

thanks

mike

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
briand
Offline
Joined: 2005-07-11
Points: 0

It could be due to one or more of a multitude of performance enhancements that we've introduced since 1.4.0. It could also be due to the microbenchmarking effect. Any benchmark that runs in 13 seconds is not likely to be measuring what you think it is measuring.

m68_1
Offline
Joined: 2006-10-02
Points: 0

thanks for the message, I come from a world of numerical calculation using c++ (no gui at all, pure number crunching using boost's matrix, vectors etc and limited amount of string manipulation, programs typically run for a few days), I used to hear from people that "java is slow in numerical calculation a few years back but I am plesently surprised to see the enhancement, would people agree that this is prime time for Java right now?

thanks

mike

briand
Offline
Joined: 2005-07-11
Points: 0

Let me bit a bit more explicit. If you are not saving the results of the computations, then the HotSpot JIT may just be factoring all of your code away. It's also possible that you are comparing interpreted code performance to JIT'ed code performance (or even interpreted code performance to something the JIT optimized to a noop). These subteties change from release to release. which is one reason why we warn people about the dangers of microbenchmarks.

Is Java useful for numerical computation - in general it will work well for many numerical codes. There are places where it may not be as good as native code due to how Java handles multidimensional arrays and how they get moved around by the garbage collector. YMMV.

You might want to consider looking at the SciMark2 benchmark for some comparisons of different numerical kernels.

http://math.nist.gov/scimark2/

It's not a perfect set of benchmarks, but it should give you a feel for how Java can perform on numerical codes and it does a reasonable job of warming up the JVM and avoiding some microbenchmark issues. However, some of the subtests are sensitive to cache effects (just adding the right lenght benign command line argument can drastically change the performance of some of its subtests)