Reputation: 368
I have following piece of code:
List<Long> array = new ArrayList<>();
for (int i = 0; i < 30000; i++)
{
array.add(Long.valueOf(i));
}
for (int j = 0; j < 30000; j++)
{
for (int i = 0; i < 30000 - j; i++)
{
array.set(i, array.get(i) + j);
}
}
When I compile it and run it under Oracle JVM on my local machine (JRE 1.7_0_71, Win 7 64bit, 4 Cores, 8GB RAM), I get times around 3,5s for run.
1.run: 3446ms
2.run: 3485ms
3.run: 3546ms
4.run: 3721ms
5.run: 3573ms
When I run it on AIX machine (POWER7+, 16 Cores, 64GB RAM) with IBM JVM (j9, java 7,build pap6470_27sr2-20141101_01(SR2)), I get results at almost 9s per run.
1.run: 8518ms
2.run: 8548ms
3.run: 8499ms
4.run: 8486ms
5.run: 9235ms
Any idea where could be catch?
Upvotes: 1
Views: 1628
Reputation: 101
We have done very detailed analysis using Dynatrace, and we have found that the IBM JDK on Windows simply outperforms the same IBM JDK release on AIX, by a wide margin.
We did get significant improvement on AIX by moving from JDK 1.6 to 1.7. Research seems to indicate that V8 has some slow down, again.
The time spent seems to be actual CPU time. The IBM JDK on AIX appears to just be working harder to do the same amount of work.
Upvotes: 0
Reputation: 2475
You have 3 issues.
Of these, the biggest impact in this case will be the IBM JRE which has really poor performance for loops. Were you doing file work, you'd find it was slow due to the operating system. There are many many causes of slowness with this combination, your best bet is to move to x86, Linux and Oracle.
Upvotes: 1