-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
kestrel
-
generic
-
solaris_7
Bug 4254028 indicated a way to speed up the implementation of the method
IntegerInterleavedRaster.setDataElements, which is used heavily by Adobe's
Java acrobat reader (javacrobat). The suggestion comes from a SCSL licensee.
The suggested fix is reasonable but is in fact more general than necessary.
An IntegerInterleavedRaster is required to have a SinglePixelPackedSampleModel,
which always has numDataElements == 1, and also enforces pixelStride == 1.
Therefore a number of methods may be simplified and in particular the
get/setDataElements methods can use System.arraycopy which should result
in a further speedup.
Other methods can also benefit from being able to assume that pixelStride ==
numDataElements == 1. The class should probably be marked final or other
steps taken to ensure that the existence of this constraint is understood
by anyone who wishes to modify this class.
The techniques suggested could still be applicable to other Raster subclasses.
The new code is supplied in the "Suggested Fix" section.
IntegerInterleavedRaster.setDataElements, which is used heavily by Adobe's
Java acrobat reader (javacrobat). The suggestion comes from a SCSL licensee.
The suggested fix is reasonable but is in fact more general than necessary.
An IntegerInterleavedRaster is required to have a SinglePixelPackedSampleModel,
which always has numDataElements == 1, and also enforces pixelStride == 1.
Therefore a number of methods may be simplified and in particular the
get/setDataElements methods can use System.arraycopy which should result
in a further speedup.
Other methods can also benefit from being able to assume that pixelStride ==
numDataElements == 1. The class should probably be marked final or other
steps taken to ensure that the existence of this constraint is understood
by anyone who wishes to modify this class.
The techniques suggested could still be applicable to other Raster subclasses.
The new code is supplied in the "Suggested Fix" section.
- relates to
-
JDK-4254028 IntegerInterleavedRaster.setDataElements() slow by a factor of 2.5 to 4
-
- Resolved
-