-
Enhancement
-
Resolution: Won't Fix
-
P4
-
9, 10
-
sparc
The fix JDK-8151163 updates ByteBuffer and views to consistently leverage the Unsafe.get*Unaligned methods.
On platforms where those methods are intrinsic performance is improved, such as on x86, which supports unaligned loads/stores.
On SPARC, which does not natively support unaligned loads/stores, those methods are not intrinsic, and the Java implementation is leveraged. Initial performance analysis indicates thatJDK-8151163 introduces a regression on SPARC for misalignment when loading/storing bytes is necessary, which requires 3 misalignment checks before such bytes are accessed.
Analysis of generated code is required to better understand how Unsafe access behaves, especially in unrolled loops.
A new Unsafe method that explicitly separates out the possibly misaligned base from an aligned (per unit size) offset may help, since the base misalignment check could be hoisted out of a loop.
Making get*Unaligned intrinsic may also help. For example, performing two aligned load instructions and then extracting the misaligned value (see instructions FALIGNDATA and ALIGNADDRESS http://www.oracle.com/technetwork/server-storage/sun-sparc-enterprise/documentation/sparc-architecture-2015-2868130.pdf).
On platforms where those methods are intrinsic performance is improved, such as on x86, which supports unaligned loads/stores.
On SPARC, which does not natively support unaligned loads/stores, those methods are not intrinsic, and the Java implementation is leveraged. Initial performance analysis indicates that
Analysis of generated code is required to better understand how Unsafe access behaves, especially in unrolled loops.
A new Unsafe method that explicitly separates out the possibly misaligned base from an aligned (per unit size) offset may help, since the base misalignment check could be hoisted out of a loop.
Making get*Unaligned intrinsic may also help. For example, performing two aligned load instructions and then extracting the misaligned value (see instructions FALIGNDATA and ALIGNADDRESS http://www.oracle.com/technetwork/server-storage/sun-sparc-enterprise/documentation/sparc-architecture-2015-2868130.pdf).
- relates to
-
JDK-8151163 All Buffer implementations should leverage Unsafe unaligned accessors
- Resolved
-
JDK-8169192 Poor ByteBuffer performance on SPARC
- Closed