EVALUATION
Thanks to ###@###.###, ###@###.###, and most importantly the
Java2D build archives maintained by ###@###.###, have isolated
this to a performance regression in FloatBuffer and DoubleBuffer introduced
during the fix for 4804304. The root cause is the conversion of float <-> int
and double <-> long in the direct buffer case where byte swapping is not needed.
As a specific example, the generated sources in e.g. DirectFloatBufferU.java
currently look like
public FloatBuffer put(int i, float x) {
unsafe.putInt(ix(checkIndex(i)), (Float.floatToRawIntBits(x)));
return this;
}
where they should look like
public FloatBuffer put(int i, float x) {
unsafe.putFloat(ix(checkIndex(i)), x);
return this;
}
All of the get and put operations in the template files need to be
conditionalized on whether byte swapping is being done when deciding whether to
perform float <-> int and long <-> double conversions.
The attached FloatBufferPerformanceRegression.java illustrates the factor of
5 to 6 performance slowdown incurred by the unneeded conversion. This occurs on
both SPARC and x86 with both the client and server compilers so the priority
has been raised.
###@###.### 2003-04-21
Since the fix for 4804304 was apparently backported to 1.4.1_03 the fix for
this bug will need to be brought back as well.
###@###.### 2003-04-21
|