Friday, April 29, 2005

Bytecode of method variables

Having installed the Bytecode Outline Eclipse plugin, and read the online instruction reference it would appear that the following two code extracts produce similar bytecode:

for (final java.util.Iterator iter = categories.iterator(); iter.hasNext();) {
final String s = (String)iter.next();
}

String s=null;
for (final java.util.Iterator iter = categories.iterator(); iter.hasNext();) {
s = (String)iter.next();
}

ALOAD appears to be used in both cases, implying that there is no performance advantage gained by moving the String outside the for loop

Friday, April 01, 2005

Why the SPARC architecture is dead

The project (Java application, consisting of a number of server processes) I work on currently uses a Sun Fire 15K server in production (32G RAM, 12 CPU). Today we decided to test the same application on a Sun Fire v40z server (AMD Opteron 4 CPU, 32G RAM).

Running the same performance test on both server configurations, we found that the Opteron server was 3x faster than the SPARC server. Another group have done a similar server comparison but using there multi-process multi-thread C++ server and found a 3-4x speed improvement.

It's quite interesting to compare the cost of both systems - 15K vs V40z.

Given the performance improvement and cost savings, it's difficult to see where Sun is going with the SPARC architecture.